Skip to content

Instantly share code, notes, and snippets.

@yozx
Created April 15, 2020 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yozx/1ca3f6eae91fea0d2d8030ef3c4bef2f to your computer and use it in GitHub Desktop.
Save yozx/1ca3f6eae91fea0d2d8030ef3c4bef2f to your computer and use it in GitHub Desktop.
telegram_proxy_checker
101.83.41.28:1080
121.40.66.129:1080
117.27.12.214:1080
119.146.131.247:8080
120.236.253.250:1081
120.236.253.116:1081
114.67.71.90:1080
47.100.106.114:50893
47.100.106.114:56826
106.14.222.35:49249
47.100.106.114:54877
106.14.222.35:51159
47.100.106.114:60212
106.14.222.35:50882
47.100.106.114:52202
47.100.106.114:50782
47.100.106.114:54187
47.100.106.114:49418
154.8.159.52:1080
47.100.106.114:57106
106.14.222.35:52249
47.100.106.114:60486
106.14.222.35:57684
106.14.222.35:50789
47.100.106.114:52774
47.100.106.114:54451
47.100.106.114:53018
47.100.106.114:55675
47.100.106.114:54486
47.100.106.114:60010
106.14.222.35:52970
47.100.106.114:63168
106.14.222.35:58767
106.14.222.35:51285
47.100.106.114:55318
47.100.106.114:54601
47.100.106.114:57502
47.100.106.114:55123
47.100.106.114:58812
47.100.106.114:54841
219.153.15.138:1080
47.100.106.114:60114
106.14.222.35:60695
47.100.106.114:63272
106.14.222.35:49386
106.14.222.35:60216
106.14.222.35:54849
47.100.106.114:56252
47.100.106.114:61276
47.100.106.114:57616
47.100.106.114:56922
47.100.106.114:60982
47.100.106.114:56346
106.14.222.35:49769
47.100.106.114:60696
106.14.222.35:62590
106.14.222.35:50473
106.14.242.17:52712
106.14.222.35:57052
47.100.106.114:60324
47.100.106.114:61342
47.100.106.114:58299
47.100.106.114:57682
47.100.106.114:61382
47.100.106.114:56718
106.14.222.35:50565
47.100.106.114:60996
106.14.222.35:63710
106.14.222.35:52243
106.14.242.17:52780
106.14.222.35:63342
47.100.106.114:60674
47.100.106.114:62224
47.100.106.114:60558
47.100.106.114:58942
47.100.106.114:62318
47.100.106.114:60082
47.100.106.114:62044
106.14.242.17:52812
106.14.222.35:64590
47.100.106.114:60702
47.100.106.114:62336
47.100.106.114:61552
47.100.106.114:59290
47.100.106.114:63294
47.100.106.114:61518
47.100.106.114:62622
106.14.242.17:52840
106.14.242.17:52287
47.100.106.114:61236
47.100.106.114:62860
47.100.106.114:59376
47.100.106.114:61998
47.100.106.114:63750
47.100.106.114:63544
106.14.242.17:52876
106.14.242.17:53083
47.100.106.114:61665
47.100.106.114:63420
47.100.106.114:59446
47.100.106.114:62334
106.14.242.17:53217
106.14.242.17:53129
47.100.106.114:62840
47.100.106.114:64043
47.100.106.114:63564
47.100.106.114:62898
106.14.242.17:53295
106.14.242.17:53520
47.100.106.114:64080
47.99.167.227:1080
47.100.106.114:62954
47.100.106.114:63732
106.14.242.17:53574
106.14.242.17:53564
47.100.106.114:63822
106.14.242.17:53676
106.14.242.17:54035
106.14.242.17:53730
106.14.242.17:54087
106.14.242.17:53971
106.14.242.17:54396
106.14.242.17:54197
106.14.242.17:54369
106.14.242.17:54512
106.14.242.17:54552
106.14.242.17:54673
106.14.242.17:55618
106.14.242.17:54767
106.14.242.17:55729
106.14.242.17:54941
106.14.242.17:55924
106.14.242.17:55017
106.14.242.17:56018
106.14.242.17:55346
106.14.242.17:56197
106.14.242.17:55442
106.14.242.17:56301
106.14.242.17:55559
106.14.242.17:56491
106.14.242.17:55844
106.14.242.17:56643
106.14.242.17:56176
106.14.242.17:56712
106.14.242.17:56453
106.14.242.17:56728
106.14.242.17:56768
106.14.242.17:56752
106.14.242.17:56798
106.14.242.17:57058
106.14.242.17:56882
106.14.242.17:57129
106.14.242.17:57067
106.14.242.17:58017
106.14.242.17:57411
106.14.242.17:58091
106.14.242.17:57492
106.14.242.17:57524
106.14.242.17:57653
106.14.242.17:57809
106.14.242.17:58573
106.14.222.35:50103
106.14.222.35:52365
106.14.222.35:50591
106.14.242.17:51326
106.14.222.35:52029
106.14.222.35:57581
106.14.243.103:49231
106.14.243.103:49466
120.236.254.184:1081
121.40.162.239:1080
223.247.158.170:1080
106.14.222.35:50587
106.14.222.35:52514
106.14.222.35:52988
106.14.242.17:51508
106.14.222.35:53312
106.14.222.35:58575
106.14.243.103:49310
106.14.243.103:49493
183.233.181.216:1081
106.14.222.35:51593
106.14.242.17:52617
106.14.222.35:62755
106.14.242.17:52387
106.14.242.17:51900
106.14.222.35:64772
106.14.243.103:49318
106.14.243.103:49542
106.14.222.35:52505
106.14.242.17:52702
106.14.242.17:52411
106.14.242.17:52439
106.14.242.17:52657
106.14.242.17:52736
106.14.243.103:49406
106.14.243.103:49613
106.14.222.35:53143
106.14.242.17:52792
106.14.242.17:52499
106.14.242.17:52551
106.14.242.17:52718
106.14.242.17:52866
106.14.243.103:49420
106.14.243.103:50393
183.233.183.71:1081
182.92.101.140:1080
106.14.242.17:51719
106.14.242.17:53093
106.14.242.17:52782
106.14.242.17:52575
106.14.242.17:52770
106.14.242.17:52963
106.14.243.103:49496
106.14.243.103:51104
106.14.242.17:52377
106.14.242.17:53099
106.14.242.17:52886
106.14.242.17:52647
106.14.242.17:52804
106.14.242.17:53145
106.14.243.103:49697
106.14.243.103:51365
106.14.242.17:52465
106.14.242.17:53153
106.14.242.17:52969
106.14.242.17:52762
106.14.242.17:52842
106.14.242.17:53221
106.14.243.103:50050
106.14.243.103:61441
106.14.242.17:52680
106.14.242.17:53436
106.14.242.17:53157
106.14.242.17:53488
106.14.242.17:53207
106.14.242.17:53301
106.14.243.103:50289
106.14.243.103:61622
106.14.242.17:52682
106.14.242.17:53544
106.14.242.17:53159
106.14.242.17:53506
106.14.242.17:53383
106.14.242.17:53484
106.14.243.103:50399
106.14.243.103:61658
106.14.242.17:52750
106.14.242.17:53742
106.14.242.17:53401
106.14.242.17:53632
106.14.242.17:53459
106.14.242.17:53582
106.14.243.103:50811
106.14.243.103:61861
106.14.242.17:52824
106.14.242.17:54005
106.14.242.17:53486
106.14.242.17:53696
106.14.242.17:53502
106.14.242.17:53979
106.14.243.103:51343
106.14.243.103:62067
106.14.242.17:52926
106.14.242.17:54472
106.14.242.17:53532
106.14.242.17:53726
106.14.242.17:53561
106.14.242.17:54061
106.14.243.103:51355
106.14.243.103:62099
106.14.242.17:53028
106.14.242.17:54506
106.14.242.17:53738
106.14.242.17:53951
106.14.242.17:53652
106.14.242.17:54125
106.14.243.103:51737
106.14.243.103:62117
106.14.242.17:53137
106.14.242.17:54646
106.14.242.17:53893
106.14.242.17:54053
106.14.242.17:53658
106.14.242.17:54153
106.14.243.103:54921
106.14.243.103:62158
106.14.242.17:53139
106.14.242.17:54927
106.14.242.17:54043
106.14.242.17:54390
106.14.242.17:53710
106.14.242.17:54378
106.14.243.103:60714
106.14.243.103:62210
106.14.242.17:53375
106.14.242.17:55619
106.14.242.17:54131
106.14.242.17:54638
106.14.242.17:53732
106.14.242.17:54416
106.14.243.103:61395
106.14.243.103:62793
106.14.242.17:53435
106.14.242.17:55699
106.14.242.17:54404
106.14.242.17:54803
106.14.242.17:53967
106.14.242.17:54460
106.14.243.103:61543
106.14.243.103:62897
106.14.242.17:53455
106.14.242.17:55810
106.14.242.17:54428
106.14.242.17:55278
106.14.242.17:54344
106.14.242.17:54550
106.14.243.103:61740
106.14.243.103:64117
106.14.242.17:53552
106.14.242.17:55826
106.14.242.17:54478
106.14.242.17:55378
106.14.242.17:54380
106.14.242.17:54733
106.14.243.103:61891
106.14.243.103:64334
106.14.242.17:53646
106.14.242.17:56051
106.14.242.17:54743
106.14.242.17:55511
106.14.242.17:54508
106.14.242.17:54913
106.14.243.103:62429
106.14.243.103:64476
106.14.242.17:53859
106.14.242.17:56363
106.14.242.17:54779
106.14.242.17:55683
106.14.242.17:54564
106.14.242.17:54955
106.14.243.103:62799
106.14.243.103:64634
106.14.242.17:54007
106.14.242.17:56631
106.14.242.17:54911
106.14.242.17:55888
106.14.242.17:54642
106.14.242.17:54991
106.14.243.103:62855
106.14.243.103:64698
106.14.242.17:54037
106.14.242.17:57199
106.14.242.17:54969
106.14.242.17:56271
106.14.242.17:54703
106.14.242.17:55100
106.14.243.103:62904
106.14.243.103:64820
106.14.242.17:54201
106.14.242.17:57478
106.14.242.17:55011
106.14.242.17:56627
106.14.242.17:54759
106.14.242.17:55190
106.14.243.103:63228
106.14.243.103:64836
106.14.242.17:54276
106.14.242.17:57573
106.14.242.17:55138
106.14.242.17:56790
106.14.242.17:54947
106.14.242.17:55210
106.14.243.103:63496
106.52.220.92:1080
106.14.242.17:54412
106.14.242.17:57692
106.14.242.17:55613
106.14.242.17:57620
106.14.242.17:55555
106.14.242.17:55332
106.14.243.103:63575
112.16.5.62:1080
106.14.242.17:54464
106.14.242.17:57973
106.14.242.17:57466
106.14.242.17:58099
106.14.242.17:56199
106.14.242.17:55591
106.14.243.103:63800
106.14.242.17:54482
106.14.242.17:58255
106.14.242.17:57488
106.14.242.17:58535
106.14.242.17:56371
106.14.242.17:56076
106.14.243.103:63864
106.14.242.17:54598
106.14.243.103:49209
106.14.242.17:61487
106.14.242.17:61714
106.14.242.17:56593
106.14.242.17:56092
106.14.243.103:64040
106.14.242.17:54663
106.14.243.103:49320
106.14.243.103:49450
106.14.243.103:49330
106.14.242.17:56994
106.14.242.17:56498
106.14.243.103:64241
106.14.242.17:54781
106.14.243.103:49386
106.14.243.103:49484
106.14.243.103:49384
106.14.242.17:57025
106.14.242.17:56898
106.14.243.103:64445
106.14.242.17:55262
106.14.243.103:49538
106.14.243.103:50099
106.14.243.103:49520
106.14.242.17:57109
106.14.242.17:57117
106.14.243.103:64650
106.14.242.17:55948
106.14.243.103:49540
106.14.243.103:50446
106.14.243.103:49603
106.14.242.17:57650
106.14.242.17:57309
106.14.243.103:64807
106.14.242.17:56209
106.14.243.103:49802
106.14.243.103:50651
106.14.243.103:50016
106.14.242.17:57879
106.14.242.17:57430
106.14.243.103:64868
106.14.242.17:56421
106.14.243.103:50081
106.14.243.103:50909
106.14.243.103:51192
106.14.242.17:58077
106.14.242.17:57590
106.14.243.103:64988
106.14.242.17:56766
106.14.243.103:50199
106.14.243.103:52867
106.14.243.103:54987
106.14.242.17:58079
106.14.242.17:57801
106.14.242.17:56830
106.14.243.103:50239
106.14.243.103:61191
106.14.243.103:59623
106.14.242.17:58257
106.14.242.17:57901
106.14.242.17:57081
106.14.243.103:50452
106.14.243.103:61529
106.14.243.103:60650
106.14.242.17:58994
106.14.242.17:58267
106.14.242.17:57119
106.14.243.103:50624
106.14.243.103:61618
106.14.243.103:61123
106.14.242.17:60666
106.14.242.17:60993
106.14.242.17:57217
106.14.243.103:50758
106.14.243.103:61630
106.14.243.103:62236
106.14.243.103:49193
106.14.243.103:49227
106.14.242.17:57546
106.14.243.103:50849
106.14.243.103:62579
106.14.243.103:62440
106.14.243.103:49197
106.14.243.103:49292
106.14.242.17:57675
106.14.243.103:50905
106.14.243.103:62693
106.14.243.103:62735
106.14.243.103:49287
106.14.243.103:49298
106.14.242.17:58009
106.14.243.103:51441
106.14.243.103:62697
106.14.243.103:63130
106.14.243.103:49290
106.14.243.103:49300
106.14.242.17:58043
106.14.243.103:60347
106.14.243.103:63329
106.14.243.103:63176
106.14.243.103:49376
106.14.243.103:49382
106.14.242.17:58319
106.14.243.103:61509
106.14.243.103:63485
106.14.243.103:63182
106.14.243.103:49378
106.14.243.103:50012
106.14.242.17:58365
106.14.243.103:61847
106.14.243.103:63517
106.14.243.103:63248
106.14.243.103:49418
106.14.243.103:50025
106.14.243.103:49432
106.14.243.103:61902
106.14.243.103:63561
106.14.243.103:64008
106.14.243.103:49799
106.14.243.103:50724
106.14.243.103:49556
106.14.243.103:62589
106.14.243.103:63695
106.14.243.103:64115
106.14.243.103:49928
106.14.243.103:51168
106.14.243.103:49607
106.14.243.103:62858
106.14.243.103:63780
106.14.243.103:64172
106.14.243.103:50179
106.14.243.103:51341
106.14.243.103:49715
106.14.243.103:62871
106.14.243.103:64134
106.14.243.103:64367
106.14.243.103:50626
106.14.243.103:60229
106.14.243.103:49986
106.14.243.103:62984
106.14.243.103:64359
106.14.243.103:64614
106.14.243.103:50788
106.14.243.103:61431
106.14.243.103:50036
106.14.243.103:63034
106.14.243.103:64411
106.14.243.103:64828
106.14.243.103:50977
106.14.243.103:61505
106.14.243.103:50798
106.14.243.103:63036
106.14.243.103:64598
111.230.138.177:1080
106.14.243.103:59663
106.14.243.103:61562
106.14.243.103:61734
106.14.243.103:63038
106.14.243.103:64740
106.14.243.103:61499
106.14.243.103:61754
106.14.243.103:63335
106.14.243.103:65238
106.14.243.103:61668
106.14.243.103:61853
106.14.243.103:62105
106.14.243.103:63357
106.14.243.103:62115
106.14.243.103:62282
106.14.243.103:63429
106.14.243.103:62121
106.14.243.103:62484
106.14.243.103:62519
106.14.243.103:63554
106.14.243.103:62198
106.14.243.103:62531
106.14.243.103:62719
106.14.243.103:63934
106.14.243.103:62527
106.14.243.103:62644
106.14.243.103:62812
106.14.243.103:63974
106.14.243.103:62751
106.14.243.103:62694
106.14.243.103:63146
106.14.243.103:64054
106.14.243.103:62914
106.14.243.103:62891
106.14.243.103:63171
106.14.243.103:64076
106.14.243.103:63134
106.14.243.103:63124
106.14.243.103:63278
106.14.243.103:64279
106.14.243.103:63168
106.14.243.103:63188
106.14.243.103:63397
106.14.243.103:64474
106.14.243.103:63316
106.14.243.103:63198
106.14.243.103:63553
106.14.243.103:64577
106.14.243.103:63349
106.14.243.103:63456
106.14.243.103:63657
106.14.243.103:64657
106.14.243.103:63736
106.14.243.103:63730
106.14.243.103:63702
106.14.243.103:64682
106.14.243.103:63978
106.14.243.103:63792
106.14.243.103:63786
106.14.243.165:61717
106.14.243.103:64113
106.14.243.103:63793
106.14.243.103:63862
106.14.243.103:64744
106.14.243.103:64127
106.14.243.103:63900
106.14.243.103:64752
106.14.243.103:64188
106.14.243.103:63916
106.14.243.103:64871
106.14.243.103:64810
106.14.243.103:64666
106.14.243.103:64858
106.14.243.103:64965
184.185.2.146:47659
66.110.216.221:39603
70.166.38.71:24801
66.110.216.105:39431
66.135.227.178:4145
208.97.31.229:53124
174.75.238.68:16399
174.76.48.230:4145
72.11.148.222:56533
72.210.252.152:46154
174.76.48.252:4145
174.76.48.225:4145
96.44.133.110:58690
216.144.230.233:15993
216.144.228.130:15378
96.44.183.149:55225
98.143.145.29:62354
98.143.145.30:62353
98.181.99.197:10368
184.176.166.8:17864
24.249.199.14:57335
184.178.172.13:15311
184.178.172.5:15303
184.178.172.25:15291
184.178.172.28:15294
72.221.164.35:60670
104.238.97.230:63962
104.238.97.215:32005
142.93.51.220:16653
142.93.51.220:22270
142.93.70.7:9100
142.93.51.220:39776
174.76.48.233:4145
142.93.51.220:31651
192.169.154.145:4661
45.55.159.57:9359
45.55.159.57:22743
45.55.159.57:40328
45.55.159.57:54985
45.55.159.57:64990
142.93.51.220:19314
192.169.244.82:57031
45.55.159.57:60019
206.189.238.117:8902
192.169.154.145:58200
173.236.182.75:3276
173.245.239.12:17145
208.102.51.6:58208
104.238.111.150:36226
45.55.230.207:30405
154.95.16.184:443
173.245.239.223:16938
174.70.241.27:24413
167.71.181.227:8902
104.238.97.163:35190
174.70.241.14:24392
173.245.239.177:16964
104.238.97.230:16640
174.76.35.7:36171
162.244.82.140:41815
157.245.83.186:8902
174.75.238.76:16391
174.76.48.249:4145
165.227.191.229:8902
173.236.177.197:3276
167.71.172.18:9050
66.33.209.41:41757
173.236.177.197:37394
66.33.213.39:41757
173.236.181.50:3276
66.33.211.203:41757
174.70.241.18:24404
66.33.214.101:41757
174.76.48.228:4145
68.180.105.55:10200
174.70.241.8:24398
50.62.59.248:57031
69.163.162.174:8072
174.76.48.251:4145
69.163.162.92:51513
174.76.48.246:4145
69.163.162.89:51513
69.163.163.164:43550
69.163.164.52:63889
69.163.163.179:63889
69.163.162.96:51513
69.163.165.253:63889
69.163.166.55:45740
47.49.12.168:28166
69.163.164.14:32512
69.61.200.104:36181
69.163.167.133:43550
69.163.160.91:51513
69.163.167.161:58110
69.163.161.23:43550
69.163.162.195:45740
72.49.49.11:31034
70.166.38.80:24822
69.163.162.184:43062
69.163.166.114:63889
69.163.163.203:51513
69.163.166.43:43550
134.209.174.182:8902
34.84.57.254:22080
40.83.173.141:1080
98.162.25.29:31679
96.96.33.133:1080
184.168.146.10:59518
103.216.82.19:6667
103.216.82.190:6667
103.209.64.19:6667
43.224.8.12:6667
103.21.163.76:6667
103.209.65.12:6667
103.216.82.146:6667
103.216.82.22:6667
103.216.82.18:6667
103.21.161.105:6667
103.216.82.20:6667
103.216.82.198:6667
103.216.82.199:6667
163.53.209.7:6667
159.89.162.107:3206
159.89.162.107:17921
150.129.201.30:6667
103.216.82.153:6667
103.216.82.43:6667
103.216.82.206:6667
150.129.54.111:6667
159.89.162.107:41516
150.129.151.42:6667
103.216.82.29:6667
103.240.168.138:6667
150.129.171.123:6667
159.89.162.107:46395
103.216.82.37:6667
103.241.227.108:6667
103.251.225.16:6667
43.224.8.14:6667
43.224.8.121:6667
27.116.51.178:6667
139.59.90.148:4760
139.59.90.148:20349
27.116.51.85:6667
27.54.189.173:9999
186.127.49.3:1080
186.127.133.80:1080
186.127.116.216:1080
186.127.133.54:1080
181.101.223.110:1080
181.102.29.159:1080
181.102.92.94:1080
181.102.43.177:1080
181.102.124.182:1080
181.102.80.212:1080
181.5.231.60:1080
181.102.90.66:1080
181.82.227.11:1080
181.106.192.37:1080
144.76.70.92:55245
144.76.70.92:1370
144.76.70.92:64954
213.136.89.190:38816
213.136.89.190:28573
178.63.37.114:8080
134.209.252.77:1080
128.199.208.93:59098
47.74.182.63:8080
134.209.100.103:49616
139.99.104.233:57370
139.99.104.233:58880
95.110.194.245:9666
95.110.194.245:26518
95.110.194.245:35740
95.110.194.245:54871
95.110.194.245:55402
119.28.215.215:3028
154.221.23.21:1080
13.75.64.186:4617
149.56.172.27:61228
149.56.172.30:61228
204.101.61.82:4145
185.221.153.218:8080
89.223.92.30:9017
91.238.137.108:8975
61.41.9.213:1081
61.41.9.213:10081
220.79.34.109:2018
46.161.40.104:9001
109.200.132.155:8888
110.49.101.58:1080
213.6.61.150:9999
190.26.19.250:9999
190.214.20.10:9999
212.247.250.139:39880
105.235.205.250:9999
46.99.144.194:9999
175.184.232.62:6667
51.38.129.49:1080
61.228.183.227:1080
91.209.108.168:50333
182.93.84.136:23649
91.98.103.154:1080
import asyncio
from aiohttp import (
ClientSession,
ClientConnectorError,
ClientProxyConnectionError,
ServerDisconnectedError,
)
from aiohttp_socks import ProxyConnector, ProxyError, SocksError
import time
from asyncio import TimeoutError
from typing import Any, Optional, Tuple, List, Coroutine
TIMEOUT: float = 10. # sec
FILENAME: str = 'proxy.txt'
def read(file: str) -> Optional[List[str]]:
try:
with open(file, 'r') as f:
return f.readlines()
except (OSError, FileNotFoundError) as exc:
raise exc
async def fetch(proxy: str) -> Optional[Tuple[str, float]]:
"""
Fetch url with proxy
:param proxy:
:return: proxy string, elapsed time
"""
start: float = time.perf_counter()
connector: ProxyConnector = ProxyConnector.from_url(f'socks5://{proxy}')
async with ClientSession(connector=connector) as session:
try:
async with session.get('https://api.telegram.org:443') as resp:
if resp.status == 200:
return proxy, time.perf_counter() - start
except (
ClientProxyConnectionError,
ClientConnectorError,
ServerDisconnectedError,
SocksError,
ProxyError,
OSError,
) as exc:
# print(exc.__class__.__name__)
pass
return None
async def main(filename: str):
lines = read(filename)
if not lines:
raise ValueError(f'File `{filename}` is empty, shutdown')
results: List[Tuple[str, float]] = [] # can be omitted
tasks: List[Coroutine[Any, Any, Optional[Tuple[str, float]]]] = [fetch(proxy.strip()) for proxy in
lines]
try:
for future in asyncio.as_completed(tasks, timeout=TIMEOUT):
result: Any = await future
if result:
results.append(result)
proxy, request_time = result
print(f"socks5://{proxy: <20} answered in {request_time:.2f} seconds")
# TODO: Save result
except TimeoutError as ext:
print(f"Reached {ext.__class__.__name__} ({TIMEOUT} sec)")
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main(FILENAME))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment