Skip to content

Add proxy use per site#112

Open
uBaze wants to merge 2 commits intocvandeplas:masterfrom
uBaze:master
Open

Add proxy use per site#112
uBaze wants to merge 2 commits intocvandeplas:masterfrom
uBaze:master

Conversation

@uBaze
Copy link
Copy Markdown
Contributor

@uBaze uBaze commented Mar 26, 2021

Hello,

For some needs I've implemented some changes on pystemon in order to be able to use a proxy only for some site.
It is now possible to add use-proxy directive to site in order to use random proxy only on the select site

Now the ProxyList is setted if proxy.random: yes or if one enabled site have use-proxy: yes in his configuration.
Example :

  pastebin.gr:
    enable: no
    archive-url: 'http://pastebin.gr/archive'
    archive-regex: '<td><a href="(\d+)" title='
    download-url: 'http://pastebin.gr/paste.php?download&id={id}'
    throttling: 5000
    use-proxy: yes

If proxy.random: yes proxy will still be used for all sites
I have also disabled sslVerify in order to be able to proxify https request to http servers and added 'https' for proxy in session.

The code is maybe not clean at all or far away from your guidelines. Do not hesitate to tell me if something is bad :)

Cheers !

@osagit
Copy link
Copy Markdown
Contributor

osagit commented Apr 22, 2021

Hi,
Why this feature is not merged ?
It is very usefull with pastebin.com pro for instance which need a specific proxy associated with a whitelisted IP.

Moreover it fixes an issue on calling https request through proxy in ua.py l. 196, by adding https to session proxy:

                    if random_proxy:
                        session.proxies = {'http': random_proxy, 'https': random_proxy}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants