Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy use per site #112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add proxy use per site #112

wants to merge 2 commits into from

Conversation

uBaze
Copy link
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
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