-
Notifications
You must be signed in to change notification settings - Fork 54
/
main.py
1623 lines (1440 loc) · 55.4 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from os import environ
from asyncio import get_event_loop, set_event_loop, new_event_loop, sleep
from base64 import b64decode
from contextlib import suppress
from math import ceil, floor
from secrets import choice
from time import time
from traceback import print_exc
from urllib.parse import unquote, urlparse, parse_qs
from requests import Session, head, session
from httpx import AsyncClient, ReadTimeout, Timeout
from re import compile as compiler
from re import DOTALL, findall, match, search, sub
from json import loads
from json.decoder import JSONDecodeError
from bs4 import BeautifulSoup
from pyrogram import Client, filters
from pyrogram.enums import MessageEntityType, ChatMemberStatus
from pyrogram.errors import RPCError, FloodWait, UserNotParticipant
from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup
from subprocess import Popen
from config import Config
PORT = environ.get('PORT', '80')
Popen(f"gunicorn app:app --bind 0.0.0.0:{PORT}", shell=True)
pbot = Client(
"bypasserbot",
api_id=Config.API_ID,
api_hash=Config.API_HASH,
bot_token=Config.BOT_TOKEN,
)
drivebuzz_crypt =Config.Drivebuzz_crypt
drivefire_crypt =Config.Drivefire_crypt
jiodrive_crypt =Config.Jiodrive_crypt
gadrive_crypt =Config.Gadrive_crypt
kolop_crypt =Config.Kolop_crypt
katdrive_crypt =Config.Katdrive_crypt
gdtot_crypt =Config.Gtot_crypt
appdrive_email =Config.Appdrive_email
appdrive_password =Config.Appdrive_password
hubdrive_crypt =Config.Hubdrive_crypt
sharerpw_xsrf_token =Config.Sharerpw_xsrf_token
sharerpw_laravel_session =Config.Sharerpw_laravel_session
channel_id =Config.Channel_id
http = AsyncClient(http2=True, timeout=Timeout(10.0))
try:
loop = get_event_loop()
except RuntimeError:
set_event_loop(new_event_loop())
loop = get_event_loop()
MAIN_REGEX = {
r"https?://(gplinks\.co\/)\S+": ["gplinks", "gplinks_bypass"],
r"https?://(try2link\.com\/)\S+": ["try2link", "try2link_bypass"],
r"https?://(adf\.ly/)\S+": ["adfly", "adfly_bypass"],
r"https?://(bit\.ly\/)\S+": ["bitly", "bitly_bypass"],
r"https?://(ouo\.press\/)\S+": ["ouo", "ouo_bypass"],
r"https?://(www\.shortly\.xyz\/)\S+": ["shortly", "shortly_bypass"],
r"https?://(tinyurl\.com\/)\S+": ["tinyurl", "tinyurl_bypass"],
r"https?://(thinfi\.com\/)\S+": ["thinfi", "thinfi_bypass"],
r"https?://(hypershort\.com\/)\S+": ["hypershort", "hypershort_bypass"],
r"https?://(safeurl\.sirigan\.my\.id/)\S+": ["sirigan", "sirigan_bypass"],
r"https?://(gtlinks\.me\/)\S+": ["gtlinks", "gtlinks_bypass"],
r"https?://(loan\.kinemaster\.cc\/\?token=)\S+":
["gtlinks", "gtlinks_bypass"],
r"https?://(www\.theforyou\.in\/\?token=)\S+":
["theforyou", "gtlinks_bypass"],
r"https?://(linkvertise\.com/)\S+": ["linkvertise", "linkvertise_bypass"],
r"https?://(shorte|festyy|gestyy|corneey|destyy|ceesty)\.(st|com)\/\S+": [
"shortest",
"shortest_bypass",
],
r"https?://(pkin\.me/)\S+": ["pkin", "pkin_bypass"],
r"https?://(earn4link\.in/)\S+": ["earn4link", "shortner_type_two_bypass"],
r"https?://(tekcrypt\.in/tek/)\S+":
["tekcrypt", "shortner_type_one_bypass"],
r"https?://(link\.short2url\.in/)\S+":
["short2url", "shortner_type_one_bypass"],
r"https?://(go\.rocklinks\.net/)\S+":
["rocklinks", "shortner_type_one_bypass"],
r"https?://(rocklinks\.net/)\S+":
["rocklinks", "shortner_type_one_bypass"],
r"https?://(earn\.moneykamalo\.com/)\S+": [
"moneykamalo",
"shortner_type_one_bypass",
],
r"https?://(m\.easysky\.in/)\S+": ["easysky", "shortner_type_one_bypass"],
r"https?://(indianshortner\.in/)\S+": [
"indianshortner",
"shortner_type_one_bypass",
],
r"https?://(open\.crazyblog\.in/)\S+":
["crazyblog", "shortner_type_one_bypass"],
r"https?://(link\.tnvalue\.in/)\S+":
["tnvalue", "shortner_type_one_bypass"],
r"https?://(shortingly\.me/)\S+":
["shortingly", "shortner_type_one_bypass"],
r"https?://(open2get\.in/)\S+": ["open2get", "shortner_type_two_bypass"],
r"https?://(dulink\.in/)\S+": ["dulink", "shortner_type_one_bypass"],
r"https?://(bindaaslinks\.com/)\S+":
["bindaaslinks", "shortner_type_one_bypass"],
r"https?://(pdiskshortener\.com/)\S+": [
"pdiskshortener",
"shortner_type_one_bypass",
],
r"https?://(mdiskshortner\.link/)\S+": [
"mdiskshortner",
"shortner_type_one_bypass",
],
r"https?://(go\.earnl\.xyz/)\S+": ["earnl", "shortner_type_one_bypass"],
r"https?://(g\.rewayatcafe\.com/)\S+":
["rewayatcafe", "shortner_type_one_bypass"],
r"https?://(ser2\.crazyblog\.in/)\S+":
["crazyblog", "shortner_type_one_bypass"],
r"https?://(bitshorten\.com/)\S+": [
"bitshorten", "shortner_type_one_bypass"
],
r"http?://(rocklink\.in/)\S+": ["rocklink", "shortner_type_one_bypass"],
r"https?://(droplink\.co/)\S+": ["droplink", "shortner_type_two_bypass"],
r"https?://(tnlink\.in\/)\S+": ["tnlink", "shortner_type_two_bypass"],
r"https?://(ez4short\.com/)\S+": ["ez4short", "shortner_type_two_bypass"],
r"https?://(xpshort\.com/)\S+": ["xpshort", "shortner_type_two_bypass"],
r"http?://(vearnl\.in/)\S+": ["vearnl", "shortner_type_two_bypass"],
r"https?://(adrinolinks\.in/)\S+": [
"adrinolinks", "shortner_type_two_bypass"
],
r"https?://(techymozo\.com/)\S+": [
"techymozo", "shortner_type_two_bypass"
],
r"https?://(urlsopen\.com/)\S+": ["urlopen", "shortner_type_two_bypass"],
r"https?://(linkbnao\.com/)\S+": ["linkbnao", "shortner_type_two_bypass"],
r"https?://(linksxyz\.in/)\S+": ["linksxyz", "shortner_type_two_bypass"],
r"https?://(short\-jambo\.com/)\S+": [
"short-jambo", "shortner_type_two_bypass"
],
r"https?://(ads\.droplink\.co\.in/)\S+": [
"droplink", "shortner_type_two_bypass"
],
r"https?://(linkpays\.in/)\S+": ["linkpays", "shortner_type_two_bypass"],
r"https?://(pi\-l\.ink/)\S+": ["pi-l", "shortner_type_two_bypass"],
r"https?://(link\.tnlink\.in/)\S+": ["tnlink", "shortner_type_two_bypass"],
r"https?://(anonfiles\.com)\S+": ["anonfiles", "anonfiles_bypass"],
r"https?://(antfiles\.com\/\?dl\=)\S+": ["antfiles", "antfiles_bypass"],
r"https?://(pjointe|dl4free|tenvoi|piecejointe|mesfichiers|desfichiers|megadl|dfichiers|alterupload|cjoint|1fichier|\.com/\?)\S+":
[
"1fichier",
"fichier_bypass",
],
r"https?://(gofile\.io\/d/)\S+": ["gofile", "gofile_bypass"],
r"https?://(hxfile\.co/)\S+": ["hxfile", "hxfile_bypass"],
r"https?://krakenfiles\.com/\S+": ["krakenfiles", "krakenfiles_bypass"],
r"https?://(mdisk\.me\/convertor)\S+": ["mdisk", "mdisk_bypass"],
r"https?://(www\.mediafire\.com\/download/)\S+": [
"mediafire", "mediafire_bypass"
],
r"https?://(pixeldrain\.com\/(l|u)\/)\S+": [
"pixeldrain", "pixeldrain_bypass"
],
r"https?://(racaty\.(net|io)/)\S+": ["racaty", "racaty_bypass"],
r"https?://(send\.cm/)\S+": ["sendcm", "sendcm_bypass"],
r"https?://(sfile\.mobi/)\S+": ["sfile", "sfile_bypass"],
r"https?://(www\.solidfiles\.com/v/)\S+": [
"solidfiles", "solidfiles_bypass"
],
r"https?://(sourceforge\.net/)\S+": ["sourceforge", "sourceforge_bypass"],
r"https?://(uploadbaz\.me/)\S+": ["uploadbaz", "uploadbaz_bypass"],
r"https?://(www\.upload\.ee/)\S+": ["uploadee", "uploadee_bypass"],
r"https?://(uppit\.com/)\S+": ["uppit", "uppit_bypass"],
r"https?://(userscloud\.com/)\S+": ["userscloud", "userscloud_bypass"],
r"https?://(we\.tl/)\S+": ["wetransfer", "wetransfer_bypass"],
r"https?://(yadi.sk|disk.yandex.com)\S+": ["yandex", "yandex_bypass"],
r"https?://www\d+\.zippyshare\.com/v/[^/]+/file\.html": [
"zippyshare",
"zippyshare_bypass",
],
r"https?://(fembed|femax20|fcdn|feurl|naniplay|mm9842|layarkacaxxi|naniplay\.nanime|fembed\-hd)\.(com|net|stream|icu|in|biz)\S+":
[
"fembed",
"fembed_bypass",
],
r"https?://(www\.mp4upload\.com/)\S+": ["mp4upload", "mp4upload_bypass"],
r"https?://(streamlare|sltube\.(com|org)\/v/)\S+": [
"streamlare",
"streamlare_bypass",
],
r"https?://(watchsb|streamsb)\.(com|net)\/\S+": [
"streamsb", "streamsb_bypass"
],
r"https?://(streamtape\.(com|to|xyz)/)\S+": [
"streamtape", "streamtape_bypass"
],
r"https?://(anidrive|driveroot|driveflix|indidrive|drivehub|appdrive|driveapp|driveace|gdflix|drivelinks|drivebit|drivesharer|drivepro)\.\S+": [
"appdrive", "appdrive_bypass"
],
r"https?://(drivebuzz)\S+": ["drivebuzz", "drivebuzz_bypass"],
r"https?://(drivefire)\S+": ["drivefire", "drivefire_bypass"],
r"https?://(gadrive)\S+": ["gadrive", "gadrive_bypass"],
r"https?://(jiodrive)\S+": ["jiodrive", "jiodrive_bypass"],
r"https?://(katdrive)\S+": ["katdrive", "katdrive_bypass"],
r"https?://(kolop)\S+": ["kolop", "kolop_bypass"],
r"https?://(.+)\.gdtot\.(.+)\/\S+\/\S+": ["gdtot", "gdtot_bypass"],
r"https?://(hubdrive)\S+": ["hubdrive", "hubdrive_bypass"],
r"https?://(sharer\.pw\/file)\S+": ["sharerpw", "sharerpw_bypass"],
}
class Httpx:
@staticmethod
async def get(url: str, headers: dict = None, red: bool = True):
async with AsyncClient() as ses:
return await ses.get(url, headers=headers, follow_redirects=red, timeout=Timeout(10.0))
@pbot.on_message(filters.command("start") & filters.private)
async def start(_: pbot, m: Message):
await m.reply_text("""
**Hey there i'm alive! I can bypass many URL Shortener website links**
You just need to send me the message containing the links! I will replace the un shorted link and send you back!
Do wait for 10 seconds for each link to process and bypass after sending the links!
**Support: @GreyMatter_Bots!**
**Subscribe: https://youtube.com/@GreyMattersYT**""")
return
async def handle_force_sub(bot: Client, cmd: Message):
try:
user = await bot.get_chat_member(chat_id=channel_id,
user_id=cmd.from_user.id)
if user.status in (ChatMemberStatus.BANNED,
ChatMemberStatus.RESTRICTED):
await cmd.reply_text(
text=
"Sorry, You are Banned to use me. Contact my [Support Group](https://t.me/greymatters_bots_discussion).",
disable_web_page_preview=True,
)
return 0
except UserNotParticipant:
try:
await cmd.reply_text(
text="**Please Join My Updates Channel to use me!**\n\n"
"Due to Overload, Only Channel Subscribers can use the Bot!",
reply_markup=InlineKeyboardMarkup([
[
InlineKeyboardButton(
"🤖 Join Updates Channel",
url="t.me/GreyMatter_Bots",
)
],
]),
)
return 0
except RPCError as e:
print(e.MESSAGE)
except FloodWait as ee:
await sleep(ee.value + 3)
await cmd.reply_text("Try later flooded!")
return 0
except Exception:
await cmd.reply_text(
text=
"Something went Wrong! Contact my [Support Group](https://t.me/greymatters_bots_discussion)",
disable_web_page_preview=True,
)
return 0
return 1
async def verifylink(url: str) -> int:
return 1 if url and "//t.me/" not in url and url.startswith("https://") else 0
async def shourturl(url):
client = cloudscraper.create_scraper(allow_brotli=False)
DOMAIN = "https://short.url2go.in/RJOVAq30CU7lINo9AwG4oT3eISn7"
url = url[:-1] if url[-1] == '/' else url
code = url.split("/")[-1]
final_url = f"{DOMAIN}/{code}"
ref = "https://blog.textpage.xyz/"
h = {"referer": ref}
resp = client.get(final_url,headers=h)
soup = BeautifulSoup(resp.content, "html.parser")
inputs = soup.find_all("input")
data = { input.get('name'): input.get('value') for input in inputs }
h = { "x-requested-with": "XMLHttpRequest" }
time.sleep(8)
r = client.post(f"{DOMAIN}/links/go", data=data, headers=h)
try:
return r.json()['url']
except: return "Something went wrong :("
async def sharerpw_bypass(url: str) -> str:
client = Session()
client.cookies["XSRF-TOKEN"] = sharerpw_xsrf_token
client.cookies["laravel_session"] = sharerpw_laravel_session
res = client.get(url)
token = findall("_token\s=\s'(.*?)'", res.text, DOTALL)[0]
data = {'_token': token, 'nl': 1}
try:
response = client.post(url + '/dl', headers={'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
'x-requested-with': 'XMLHttpRequest'}, data=data).json()
return response
except:
if response["message"] == "OK":
return ""
else:
return response["message"]
async def account_login(client, url: str):
data = {
'email': appdrive_email,
'password': appdrive_password,
}
client.post(f'https://{urlparse(url).netloc}/login', data=data)
async def gen_payload(data, boundary=f'{"-" * 6}_'):
data_string = ''
for item in data:
data_string += f'{boundary}\r\n'
data_string += f'Content-Disposition: form-data; name="{item}"\r\n\r\n{data[item]}\r\n'
data_string += f'{boundary}--\r\n'
return data_string
async def appdrive_lookalike(client, drive_link: str):
try:
response = client.get(drive_link).text
soup = BeautifulSoup(response, "html.parser")
new_drive_link = soup.find(class_="btn").get("href")
return new_drive_link
except:
return drive_link
async def hubdrive_bypass(url: str) -> str:
url = url[:-1] if url[-1] == '/' else url
parsed_url = urlparse(url)
client = Session()
client.cookies.update({'crypt': hubdrive_crypt})
req_url = f"{parsed_url.scheme}://{parsed_url.netloc}/ajax.php?ajax=download"
try:
res = client.post(req_url, headers={'x-requested-with': 'XMLHttpRequest'},
data={'id': url.split('/')[-1]}).json()[
'file']
gd_id = findall('gd=(.*)', res, DOTALL)[0]
except:
return ""
return f"https://drive.google.com/open?id={gd_id}"
async def gdtot_bypass(url: str) -> str:
url = url[:-1] if url[-1] == '/' else url
client = Session()
matc = findall(r"https?://(.+)\.gdtot\.(.+)\/\S+\/\S+", url)[0]
client.cookies.update({"crypt": gdtot_crypt})
response = client.get(f"https://{matc[0]}.gdtot.{matc[1]}/dld?id={url.split('/')[-1]}")
url = findall(r'URL=(.*?)"', response.text)[0]
params = parse_qs(urlparse(url).query)
if "gd" not in params or not params["gd"] or params["gd"][0] == "false":
return ""
else:
try:
decoded_id = b64decode(str(params["gd"][0])).decode("utf-8")
except:
return ""
return f"https://drive.google.com/open?id={decoded_id}"
async def appdrive_bypass(url: str) -> str:
client = Session()
client.headers.update({
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36"
})
url = client.get(url).url
response = client.get(url)
try:
key = findall(r'"key",\s+"(.*?)"', response.text)[0]
soup = BeautifulSoup(response.text, "html.parser")
ddl_btn = soup.find(id="drc")
except:
return ""
headers = {"Content-Type": f"multipart/form-data; boundary={'-' * 4}_"}
data = {'type': 1, 'key': key, 'action': 'original'}
if ddl_btn is not None:
data['action'] = 'direct'
else:
await account_login(client, url)
while data['type'] <= 3:
try:
response = client.post(url, data=await gen_payload(data), headers=headers).json();
break
except:
data['type'] += 1
if 'url' in response:
drive_link = response["url"]
if urlparse(url).netloc in (
"driveapp.in", "drivehub.in", "gdflix.pro", "drivesharer.in", "drivebit.in", "drivelinks.in",
"driveace.in",
"drivepro.in", "gdflix.top"):
return await appdrive_lookalike(client, drive_link)
else:
return drive_link
elif 'error' in response and response['error']:
return response['message']
else:
return ""
async def jiodrive_bypass(url: str) -> str:
url = url[:-1] if url[-1] == '/' else url
parsed_url = urlparse(url)
client = Session()
client.cookies.update({'crypt': jiodrive_crypt})
req_url = f"{parsed_url.scheme}://{parsed_url.netloc}/ajax.php?ajax=download"
try:
res = client.post(req_url, headers={'x-requested-with': 'XMLHttpRequest'},
data={'id': url.split('/')[-1]}).json()[
'file']
gd_id = findall('gd=(.*)', res, DOTALL)[0]
except:
return ""
drive_link = f"https://drive.google.com/open?id={gd_id}"
return drive_link
async def kolop_bypass(url: str) -> str:
url = url[:-1] if url[-1] == '/' else url
parsed_url = urlparse(url)
client = Session()
client.cookies.update({'crypt': kolop_crypt})
req_url = f"{parsed_url.scheme}://{parsed_url.netloc}/ajax.php?ajax=download"
try:
res = client.post(req_url, headers={'x-requested-with': 'XMLHttpRequest'},
data={'id': url.split('/')[-1]}).json()[
'file']
gd_id = findall('gd=(.*)', res, DOTALL)[0]
except:
return ""
drive_link = f"https://drive.google.com/open?id={gd_id}"
return drive_link
async def katdrive_bypass(url: str) -> str:
url = url[:-1] if url[-1] == '/' else url
parsed_url = urlparse(url)
client = Session()
client.cookies.update({'crypt': katdrive_crypt})
req_url = f"{parsed_url.scheme}://{parsed_url.netloc}/ajax.php?ajax=download"
try:
res = client.post(req_url, headers={'x-requested-with': 'XMLHttpRequest'},
data={'id': url.split('/')[-1]}).json()[
'file']
gd_id = findall('gd=(.*)', res, DOTALL)[0]
except:
return ""
drive_link = f"https://drive.google.com/open?id={gd_id}"
return drive_link
async def gadrive_bypass(url: str) -> str:
url = url[:-1] if url[-1] == '/' else url
parsed_url = urlparse(url)
client = Session()
client.cookies.update({'crypt': gadrive_crypt})
req_url = f"{parsed_url.scheme}://{parsed_url.netloc}/ajax.php?ajax=download"
try:
res = \
client.post(req_url, headers={'x-requested-with': 'XMLHttpRequest'}, data={'id': url.split('/')[-1]}).json()[
'file']
gd_id = findall('gd=(.*)', res, DOTALL)[0]
except:
return ""
drive_link = f"https://drive.google.com/open?id={gd_id}"
return drive_link
async def drivefire_bypass(url: str) -> str:
url = url[:-1] if url[-1] == '/' else url
parsed_url = urlparse(url)
client = Session()
client.cookies.update({'crypt': drivefire_crypt})
req_url = f"{parsed_url.scheme}://{parsed_url.netloc}/ajax.php?ajax=download"
try:
res = client.post(req_url, headers={'x-requested-with': 'XMLHttpRequest'},
data={'id': url.split('/')[-1]}).json()[
'file']
gd_id = res.rsplit("/", 1)[-1]
except:
return ""
drive_link = f"https://drive.google.com/open?id={gd_id}"
return drive_link
async def drivebuzz_bypass(url: str) -> str:
url = url[:-1] if url[-1] == '/' else url
parsed_url = urlparse(url)
client = Session()
client.cookies.update({'crypt': drivebuzz_crypt})
req_url = f"{parsed_url.scheme}://{parsed_url.netloc}/ajax.php?ajax=download"
try:
res = client.post(req_url, headers={'x-requested-with': 'XMLHttpRequest'},
data={'id': url.split('/')[-1]}).json()[
'file']
gd_id = res.rsplit("=", 1)[-1]
except:
return ""
drive_link = f"https://drive.google.com/open?id={gd_id}"
return drive_link
async def anonfiles_bypass(anonfiles_url: str) -> str:
soup = BeautifulSoup((await Httpx.get(anonfiles_url)).content,
"html.parser")
return dlurl["href"] if (dlurl := soup.find(id="download-url")) else ""
async def antfiles_bypass(antfiles_url: str) -> str:
soup = BeautifulSoup((await Httpx.get(antfiles_url)).content,
"html.parser")
if a := soup.find(class_="main-btn", href=True):
return "{0.scheme}://{0.netloc}/{1}".format(urlparse(antfiles_url),
a["href"])
return ""
async def fichier_bypass(url: str) -> str:
client = Session()
response = client.get(url, timeout=5)
soup = BeautifulSoup(response.text, "html.parser")
data = {"adz": soup.find("input").get("value")}
rate_limit = soup.find("div", {"class": "ct_warn"})
if "you must wait" in str(rate_limit).lower():
try:
numbers = [
int(word) for word in str(rate_limit).split()
if word.isdigit()
]
return f"1fichier.com is on limit for my ip. please wait {numbers[0]} min before trying again."
except:
return "1fichier.com is on limit for my ip. please wait few minutes/hour before trying again."
else:
r = client.post(url, json=data, timeout=5)
soup = BeautifulSoup(r.text, "html.parser")
return soup.find(class_="ok btn-general btn-orange").get("href")
async def krakenfiles_bypass(url: str) -> str:
soup = BeautifulSoup((await Httpx.get(url)).content, "html.parser")
token = soup.find("input", id="dl-token")["value"]
hashes = [
item["data-file-hash"]
for item in soup.find_all("div", attrs={"data-file-hash": True})
]
if not hashes:
return ""
dl_hash = hashes[0]
payload = f'------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name="token"\r\n\r\n{token}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--'
headers = {
"content-type":
"multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
"cache-control": "no-cache",
"hash": dl_hash,
}
dl_link_resp = session().post(
f"https://krakenfiles.com/download/{hash}",
data=payload,
headers=headers,
timeout=5,
)
dl_link_json = dl_link_resp.json()
download_url = dl_link_json["url"]
return download_url.replace(" ", "%20")
async def mdisk_bypass(url: str) -> str:
url = url[:-1] if url[-1] == "/" else url
token = url.split("/")[-1]
api = f"https://diskuploader.entertainvideo.com/v1/file/cdnurl?param={token}"
try:
response = (await Httpx.get(api)).json()
except JSONDecodeError:
return ""
return response["download"].replace(" ", "%20")
async def mediafire_bypass(mediafire_url: str) -> str:
link = search(r"\bhttps?://.*mediafire\.com\S+", mediafire_url)[0]
page = BeautifulSoup((await Httpx.get(link)).content, "html.parser")
return page.find("a", {"aria-label": "Download file"}).get("href")
async def pixeldrain_bypass(pixeldrain_url: str) -> str:
pixeldrain_url = (pixeldrain_url[:-1]
if pixeldrain_url[-1] == "/" else pixeldrain_url)
file_id = pixeldrain_url.split("/")[-1]
return (f"https://pixeldrain.com/api/list/{file_id}/zip"
if pixeldrain_url.split("/")[-2] == "l" else
f"https://pixeldrain.com/api/file/{file_id}")
async def racaty_bypass(url: str) -> str:
client = Session()
url = client.get(url, timeout=5).url
url = url[:-1] if url[-1] == "/" else url
token = url.split("/")[-1]
headers = {
"content-type":
"application/x-www-form-urlencoded",
"user-agent":
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
}
data = {
"op": "download2",
"id": token,
"rand": "",
"referer": "",
"method_free": "",
"method_premium": "",
}
response = client.post(url, headers=headers, data=data, timeout=5)
soup = BeautifulSoup(response.text, "html.parser")
if btn := soup.find(class_="btn btn-dow"):
return btn["href"]
return unique["href"] if (unique := soup.find(
id="uniqueExpirylink")) else ""
async def sendcm_bypass(url: str) -> str:
base_url = "https://send.cm/"
client = Session()
headers = {
"Content-Type":
"application/x-www-form-urlencoded",
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
}
response = (await Httpx.get(url)).text
soup = BeautifulSoup(response, "html.parser")
inputs = soup.find_all("input")
file_id = inputs[1]["value"]
pars = {"op": "download2", "id": file_id, "referer": url}
resp = client.post(base_url,
data=pars,
headers=headers,
allow_redirects=False,
timeout=5)
return resp.headers["Location"]
async def sfile_bypass(url: str) -> str:
headers = {
"User-Agent":
"Mozilla/5.0 (Linux; Android 8.0.1; SM-G532G Build/MMB29T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3239.83 Mobile Safari/537.36"
}
url = url[:-1] if url[-1] == "/" else url
token = url.split("/")[-1]
soup = BeautifulSoup(
(await Httpx.get(f"https://sfile.mobi/download/{token}",
headers=headers)).content,
"html.parser",
)
return soup.find("p").a.get("href")
async def solidfiles_bypass(solidfiles_url: str) -> str:
json_file = search(r"'viewerOptions\'\,\ (.*?)\)\;",
(await Httpx.get(solidfiles_url)).text)[1]
return loads(json_file)["downloadUrl"]
async def sourceforge_bypass(url: str) -> str:
link = findall(r"\bhttps?://sourceforge\.net\S+", url)[0]
file_path = findall(r"files(.*)/download", link)[0]
project = findall(r"projects?/(.*?)/files", link)[0]
mirrors = (f"https://sourceforge.net/settings/mirror_choices?"
f"projectname={project}&filename={file_path}")
page = BeautifulSoup((await Httpx.get(mirrors)).content, "html.parser")
info = page.find("ul", {"id": "mirrorList"}).findAll("li")
for mirror in info[1:]:
return f'https://{mirror["id"]}.dl.sourceforge.net/project/{project}/{file_path}?viasf=1'
return ""
async def uploadbaz_bypass(url: str) -> str:
url = url[:-1] if url[-1] == "/" else url
token = url.split("/")[-1]
client = Session()
headers = {
"content-type":
"application/x-www-form-urlencoded",
"user-agent":
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
}
data = {
"op": "download2",
"id": token,
"rand": "",
"referer": "",
"method_free": "",
"method_premium": "",
}
response = client.post(url,
headers=headers,
data=data,
allow_redirects=False,
timeout=5)
return response.headers["Location"]
async def uploadee_bypass(url: str) -> str:
soup = BeautifulSoup((await Httpx.get(url)).content, "html.parser")
link = soup.find("a", attrs={"id": "d_l"})
return link["href"]
async def uppit_bypass(url: str) -> str:
url = url[:-1] if url[-1] == "/" else url
token = url.split("/")[-1]
client = Session()
headers = {
"content-type":
"application/x-www-form-urlencoded",
"user-agent":
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
}
data = {
"op": "download2",
"id": token,
"rand": "",
"referer": "",
"method_free": "",
"method_premium": "",
}
response = client.post(url, headers=headers, data=data, timeout=5)
soup = BeautifulSoup(response.text, "html.parser")
return soup.find(
"span",
{
"style": "background:#f9f9f9;border:1px dotted #bbb;padding:7px;"
},
).a.get("href")
async def userscloud_bypass(url: str) -> str:
url = url[:-1] if url[-1] == "/" else url
token = url.split("/")[-1]
client = Session()
headers = {
"content-type":
"application/x-www-form-urlencoded",
"user-agent":
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
}
data = {
"op": "download2",
"id": token,
"rand": "",
"referer": "",
"method_free": "",
"method_premium": "",
}
response = client.post(url,
headers=headers,
data=data,
allow_redirects=False,
timeout=5)
return response.headers["Location"]
async def yandex_bypass(url: str) -> str:
api = f"https://cloud-api.yandex.net/v1/disk/public/resources/download?public_key={url}"
return (await Httpx.get(api)).json()["href"]
async def zippyshare_bypass(url: str) -> str:
client = Session()
response = client.get(url, timeout=5)
if dlbutton := search(r'href = "([^"]+)" \+ \(([^)]+)\) \+ "([^"]+)',
response.text):
folder, math_chall, filename = dlbutton.groups()
math_chall = eval(math_chall)
return f'{search("https?://[^/]+", response.url).group(0)}{folder}{math_chall}{filename}'
soup = BeautifulSoup(response.content, "html.parser")
if script := soup.find("script", text=compiler(r"(?si)\s*var a = \d+;")):
sc = str(script)
var = findall(r"var [ab] = (\d+)", sc)
omg = findall(r"\.omg (!?=) [\"']([^\"']+)", sc)
file = findall(r'"(/[^"]+)', sc)
if var and omg:
a, b = var
if eval(f"{omg[0][1]!r} {omg[1][0]} {omg[1][1]!r}") or 1:
a = ceil(int(a) // 3)
else:
a = floor(int(a) // 3)
divider = int(findall(r"(\d+)%b", sc)[0])
return search(r"(^https://www\d+.zippyshare.com)",
response.url).group(1) + "".join(
[file[0],
str(a + (divider % int(b))), file[1]])
return ""
async def fembed_bypass(url: str) -> str:
url = url[:-1] if url[-1] == "/" else url
token = url.split("/")[-1]
return (
await
http.post(f"https://fembed-hd.com/api/source/{token}")).json()["data"]
async def mp4upload_bypass(url: str) -> str:
url = url[:-1] if url[-1] == "/" else url
headers = {"referer": "https://mp4upload.com"}
token = url.split("/")[-1]
data = {
"op": "download2",
"id": token,
"rand": "",
"referer": "https://www.mp4upload.com/",
"method_free": "",
"method_premium": "",
}
response = await http.post(url, headers=headers, data=data)
return str({
"bypassed_url": response.headers["Location"],
"headers ": headers
})
async def streamlare_bypass(url: str) -> str:
CONTENT_ID = compiler(r"/[ve]/([^?#&/]+)")
API_LINK = "https://sltube.org/api/video/download/get"
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4136.7 Safari/537.36"
client = Session()
content_id = CONTENT_ID.search(url).group(1)
r = client.get(url, timeout=5).text
soup = BeautifulSoup(r, "html.parser")
csrf_token = soup.find("meta", {"name": "csrf-token"}).get("content")
xsrf_token = client.cookies.get_dict()["XSRF-TOKEN"]
headers = {
"x-requested-with": "XMLHttpRequest",
"x-csrf-token": csrf_token,
"x-xsrf-token": xsrf_token,
"referer": url,
"user-agent": user_agent,
}
payload = {"id": content_id}
result = client.post(API_LINK, headers=headers, data=payload,
timeout=5).json()["result"]
result["headers"] = {"user-agent": user_agent}
return result
async def rand_str():
array = "abcdefghijklmnopqrstuvwqyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
return "".join([choice(array) for _ in range(12)])
async def hex_encode(string: str):
return string.encode("utf-8").hex()
async def streamsb_bypass(url: str):
url = url[:-1] if url[-1] == "/" else url
if ".html" in url:
url_id = url.split("/")[-1].split(".")[-2]
else:
url_id = url.split("/")[-1]
part_one = f"{await rand_str()}||{url_id}||{await rand_str()}||streamsb"
final_url = f"https://watchsb.com/sources48/{await hex_encode(part_one)}"
headers = {
"watchsb":
"sbstream",
"referer":
"url",
"user-agent":
"Mozilla/5.0 (Linux; Android 11; 2201116PI) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Mobile Safari/537.36",
}
return (await Httpx.get(final_url,
headers=headers)).json()["stream_data"]["file"]
async def streamtape_bypass(url: str) -> str:
response = await Httpx.get(url)
if videolink := findall(r"document.*((?=id\=)[^\"']+)", response.text):
return f"https://streamtape.com/get_video?{videolink[-1]}"
return ""
async def wetransfer_bypass(url: str) -> str:
if url.startswith("https://we.tl/"):
r = head(url, allow_redirects=True)
url = r.url
recipient_id = None
params = urlparse(url).path.split("/")[2:]
if len(params) == 2:
transfer_id, security_hash = params
elif len(params) == 3:
transfer_id, recipient_id, security_hash = params
else:
return ""
j = {
"intent": "entire_transfer",
"security_hash": security_hash,
}
if recipient_id:
j["recipient_id"] = recipient_id
s = Session()
r = s.get("https://wetransfer.com/", timeout=5)
m = search(r'name="csrf-token" content="([^"]+)"', r.text)
s.headers.update({
"x-csrf-token": m[1],
"x-requested-with": "XMLHttpRequest"
})
r = s.post(
f"https://wetransfer.com/api/v4/transfers/{transfer_id}/download",
json=j,
timeout=5,
)
j = r.json()
return j["direct_link"]
async def gofile_bypass(url: str) -> str:
api_uri = "https://api.gofile.io"
url = url[:-1] if url[-1] == "/" else url
client = Session()
response = client.get(f"{api_uri}/createAccount", timeout=5).json()
data = {
"contentId": url.split("/")[-1],
"token": response["data"]["token"],
"websiteToken": 12345,
"cache": "true",
}
response = client.get(f"{api_uri}/getContent", params=data,
timeout=5).json()
for item in response["data"]["contents"].values():
if download_url := item["link"]:
return download_url
return ""
async def hxfile_bypass(url: str) -> str:
url = url[:-1] if url[-1] == "/" else url
token = url.split("/")[-1]
client = Session()
headers = {
"content-type":
"application/x-www-form-urlencoded",
"user-agent":
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
}
data = {
"op": "download2",
"id": token,
"rand": "",
"referer": "",
"method_free": "",
"method_premium": "",
}
response = client.post(url, headers=headers, data=data, timeout=5)
soup = BeautifulSoup(response.text, "html.parser")
if btn := soup.find(class_="btn btn-dow"):
return btn["href"]
return unique["href"] if (unique := soup.find(
id="uniqueExpirylink")) else ""
class BypasserNotFoundError(Exception):
"""
Raise when there is no bypasser of the giver url.
"""
class UrlConnectionError(Exception):
"""
Raise when response code of given url is not equal to 200