File tree Expand file tree Collapse file tree 5 files changed +37
-21
lines changed Expand file tree Collapse file tree 5 files changed +37
-21
lines changed Original file line number Diff line number Diff line change 2222 - name : Install dependencies
2323 run : |
2424 python3.11 -m pip install --upgrade pip
25- python3.11 -m pip install -r requirements.txt --use-pep517
25+ python3.11 -m pip install -e .[dev] --use-pep517
2626 - name : Check code style
2727 run : |
2828 python3.11 -m flake8
Original file line number Diff line number Diff line change 55 "version" : " 0.2.0" ,
66 "configurations" : [
77 {
8- "name" : " Test: Start File " ,
8+ "name" : " Start: Example " ,
99 "type" : " python" ,
1010 "request" : " launch" ,
11- "program" : " ${workspaceFolder}/start .py" ,
11+ "program" : " ${workspaceFolder}/example .py" ,
1212 "console" : " integratedTerminal" ,
1313 "justMyCode" : true
1414 },
15- {
16- "name" : " Test: Targeted" ,
17- "type" : " python" ,
18- "request" : " launch" ,
19- "module" : " pytest" ,
20- "args" : [
21- " test" ,
22- " tests.test_class_initialization" ,
23- ],
24- "django" : true ,
25- "justMyCode" : true
26- },
2715 {
2816 "name" : " Test: Pytest" ,
2917 "type" : " python" ,
3018 "request" : " launch" ,
3119 "module" : " pytest" ,
32-
33- "env" : {
34- "PYDEVD_DISABLE_FILE_VALIDATION" : " 1"
35- },
3620 "justMyCode" : true
3721 },
3822 ]
Original file line number Diff line number Diff line change @@ -91,4 +91,7 @@ def start(self) -> Queue:
9191
9292 loop .run_until_complete (task )
9393 self .logger .info (f'Data scraped! Took { datetime .now (UTC ) - started } , enjoy!' )
94- return task .result ()
94+
95+ result = task .result ()
96+ loop .close ()
97+ return result
Original file line number Diff line number Diff line change 1+ # -*- mode: python ; coding: utf-8 -*-
2+ from aproxyrelay import AProxyRelay
3+
4+ # Note: Duplicates will be removed by the library
5+ targets = [
6+ 'https://gg.my-dev.app/api/v1/proxies/available?zone=us&anonimity=all&protocol=all&page=1&size=100&type=example' ,
7+ 'https://gg.my-dev.app/api/v1/proxies/available?zone=de&anonimity=all&protocol=all&page=1&size=100&type=example' ,
8+ 'https://gg.my-dev.app/api/v1/proxies/available?zone=nl&anonimity=all&protocol=all&page=1&size=100&type=example' ,
9+ 'https://gg.my-dev.app/api/v1/proxies/available?zone=de&anonimity=all&protocol=all&page=1&size=100&type=example' ,
10+ 'https://gg.my-dev.app/api/v1/proxies/available?zone=nl&anonimity=all&protocol=all&page=1&size=100&type=example' ,
11+ ]
12+
13+ # Initialize proxy relay
14+ proxy_relay = AProxyRelay (
15+ targets = targets ,
16+ timeout = 5 ,
17+ test_proxy = True ,
18+ test_timeout = 10 ,
19+ zone = 'us' ,
20+ )
21+
22+ # Fetch data
23+ data = proxy_relay .start ()
24+
25+ # Result Queue
26+ print (data .qsize ())
27+
28+ while not data .empty ():
29+ content = data .get ()
30+ print (content )
Original file line number Diff line number Diff line change 2323 'flake8-bugbear' ,
2424 'pytest' ,
2525 'pytest-cov' ,
26- 'pytest-django' ,
2726 'pytest-sugar' ,
2827 'pytest-xdist' ,
2928 'setuptools' ,
You can’t perform that action at this time.
0 commit comments