-
Notifications
You must be signed in to change notification settings - Fork 863
Expand file tree
/
Copy pathExtractorApi.kt
More file actions
1368 lines (1277 loc) · 44.1 KB
/
ExtractorApi.kt
File metadata and controls
1368 lines (1277 loc) · 44.1 KB
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
package com.lagradost.cloudstream3.utils
import com.fasterxml.jackson.annotation.JsonIgnore
import com.lagradost.cloudstream3.AudioFile
import com.lagradost.cloudstream3.IDownloadableMinimum
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.USER_AGENT
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.extractors.Acefile
import com.lagradost.cloudstream3.extractors.Ahvsh
import com.lagradost.cloudstream3.extractors.Aico
import com.lagradost.cloudstream3.extractors.Asnwish
import com.lagradost.cloudstream3.extractors.Auvexiug
import com.lagradost.cloudstream3.extractors.Awish
import com.lagradost.cloudstream3.extractors.BgwpCC
import com.lagradost.cloudstream3.extractors.BigwarpArt
import com.lagradost.cloudstream3.extractors.BigwarpIO
import com.lagradost.cloudstream3.extractors.Blogger
import com.lagradost.cloudstream3.extractors.ByseSX
import com.lagradost.cloudstream3.extractors.Bysezejataos
import com.lagradost.cloudstream3.extractors.ByseBuho
import com.lagradost.cloudstream3.extractors.ByseVepoin
import com.lagradost.cloudstream3.extractors.ByseQekaho
import com.lagradost.cloudstream3.extractors.Cavanhabg
import com.lagradost.cloudstream3.extractors.Cda
import com.lagradost.cloudstream3.extractors.Cdnplayer
import com.lagradost.cloudstream3.extractors.CdnwishCom
import com.lagradost.cloudstream3.extractors.CloudMailRu
import com.lagradost.cloudstream3.extractors.ContentX
import com.lagradost.cloudstream3.extractors.CsstOnline
import com.lagradost.cloudstream3.extractors.D0000d
import com.lagradost.cloudstream3.extractors.D000dCom
import com.lagradost.cloudstream3.extractors.DBfilm
import com.lagradost.cloudstream3.extractors.Dailymotion
import com.lagradost.cloudstream3.extractors.Darkibox
import com.lagradost.cloudstream3.extractors.DatabaseGdrive
import com.lagradost.cloudstream3.extractors.DatabaseGdrive2
import com.lagradost.cloudstream3.extractors.DesuArcg
import com.lagradost.cloudstream3.extractors.DesuDrive
import com.lagradost.cloudstream3.extractors.DesuOdchan
import com.lagradost.cloudstream3.extractors.DesuOdvip
import com.lagradost.cloudstream3.extractors.Dhcplay
import com.lagradost.cloudstream3.extractors.Dhtpre
import com.lagradost.cloudstream3.extractors.Dokicloud
import com.lagradost.cloudstream3.extractors.DoodCxExtractor
import com.lagradost.cloudstream3.extractors.DoodLaExtractor
import com.lagradost.cloudstream3.extractors.DoodPmExtractor
import com.lagradost.cloudstream3.extractors.DoodShExtractor
import com.lagradost.cloudstream3.extractors.DoodSoExtractor
import com.lagradost.cloudstream3.extractors.DoodToExtractor
import com.lagradost.cloudstream3.extractors.DoodWatchExtractor
import com.lagradost.cloudstream3.extractors.DoodWfExtractor
import com.lagradost.cloudstream3.extractors.DoodWsExtractor
import com.lagradost.cloudstream3.extractors.DoodYtExtractor
import com.lagradost.cloudstream3.extractors.Doodspro
import com.lagradost.cloudstream3.extractors.Dsvplay
import com.lagradost.cloudstream3.extractors.Doodporn
import com.lagradost.cloudstream3.extractors.DoodstreamCom
import com.lagradost.cloudstream3.extractors.Dooood
import com.lagradost.cloudstream3.extractors.Ds2play
import com.lagradost.cloudstream3.extractors.Ds2video
import com.lagradost.cloudstream3.extractors.DsstOnline
import com.lagradost.cloudstream3.extractors.Dumbalag
import com.lagradost.cloudstream3.extractors.Dwish
import com.lagradost.cloudstream3.extractors.Embedgram
import com.lagradost.cloudstream3.extractors.EmturbovidExtractor
import com.lagradost.cloudstream3.extractors.Evoload
import com.lagradost.cloudstream3.extractors.Evoload1
import com.lagradost.cloudstream3.extractors.Ewish
import com.lagradost.cloudstream3.extractors.FEmbed
import com.lagradost.cloudstream3.extractors.FEnet
import com.lagradost.cloudstream3.extractors.Fastream
import com.lagradost.cloudstream3.extractors.FeHD
import com.lagradost.cloudstream3.extractors.Fembed9hd
import com.lagradost.cloudstream3.extractors.FileMoon
import com.lagradost.cloudstream3.extractors.FileMoonIn
import com.lagradost.cloudstream3.extractors.FileMoonSx
import com.lagradost.cloudstream3.extractors.FilemoonV2
import com.lagradost.cloudstream3.extractors.Filesim
import com.lagradost.cloudstream3.extractors.Multimoviesshg
import com.lagradost.cloudstream3.extractors.FlaswishCom
import com.lagradost.cloudstream3.extractors.FourCX
import com.lagradost.cloudstream3.extractors.FourPichive
import com.lagradost.cloudstream3.extractors.FourPlayRu
import com.lagradost.cloudstream3.extractors.Fplayer
import com.lagradost.cloudstream3.extractors.FsstOnline
import com.lagradost.cloudstream3.extractors.GDMirrorbot
import com.lagradost.cloudstream3.extractors.GUpload
import com.lagradost.cloudstream3.extractors.GamoVideo
import com.lagradost.cloudstream3.extractors.Gdriveplayer
import com.lagradost.cloudstream3.extractors.Gdriveplayerapi
import com.lagradost.cloudstream3.extractors.Gdriveplayerapp
import com.lagradost.cloudstream3.extractors.Gdriveplayerbiz
import com.lagradost.cloudstream3.extractors.Gdriveplayerco
import com.lagradost.cloudstream3.extractors.Gdriveplayerfun
import com.lagradost.cloudstream3.extractors.Gdriveplayerio
import com.lagradost.cloudstream3.extractors.Gdriveplayerme
import com.lagradost.cloudstream3.extractors.Gdriveplayerorg
import com.lagradost.cloudstream3.extractors.Gdriveplayerus
import com.lagradost.cloudstream3.extractors.Geodailymotion
import com.lagradost.cloudstream3.extractors.Gofile
import com.lagradost.cloudstream3.extractors.GoodstreamExtractor
import com.lagradost.cloudstream3.extractors.Guccihide
import com.lagradost.cloudstream3.extractors.Guxhag
import com.lagradost.cloudstream3.extractors.HDMomPlayer
import com.lagradost.cloudstream3.extractors.HDPlayerSystem
import com.lagradost.cloudstream3.extractors.HDStreamAble
import com.lagradost.cloudstream3.extractors.Habetar
import com.lagradost.cloudstream3.extractors.Haxloppd
import com.lagradost.cloudstream3.extractors.HglinkTo
import com.lagradost.cloudstream3.extractors.HgplayCDN
import com.lagradost.cloudstream3.extractors.Hotlinger
import com.lagradost.cloudstream3.extractors.HubCloud
import com.lagradost.cloudstream3.extractors.Hxfile
import com.lagradost.cloudstream3.extractors.HlsWish
import com.lagradost.cloudstream3.extractors.InternetArchive
import com.lagradost.cloudstream3.extractors.JWPlayer
import com.lagradost.cloudstream3.extractors.Jeniusplay
import com.lagradost.cloudstream3.extractors.Jodwish
import com.lagradost.cloudstream3.extractors.Keephealth
import com.lagradost.cloudstream3.extractors.KotakAnimeid
import com.lagradost.cloudstream3.extractors.Kotakajair
import com.lagradost.cloudstream3.extractors.Krakenfiles
import com.lagradost.cloudstream3.extractors.Kswplayer
import com.lagradost.cloudstream3.extractors.LayarKaca
import com.lagradost.cloudstream3.extractors.Linkbox
import com.lagradost.cloudstream3.extractors.LuluStream
import com.lagradost.cloudstream3.extractors.Lulustream1
import com.lagradost.cloudstream3.extractors.Lulustream2
import com.lagradost.cloudstream3.extractors.Luluvdoo
import com.lagradost.cloudstream3.extractors.Luxubu
import com.lagradost.cloudstream3.extractors.Lvturbo
import com.lagradost.cloudstream3.extractors.MailRu
import com.lagradost.cloudstream3.extractors.Maxstream
import com.lagradost.cloudstream3.extractors.Mediafire
import com.lagradost.cloudstream3.extractors.Megacloud
import com.lagradost.cloudstream3.extractors.Meownime
import com.lagradost.cloudstream3.extractors.MetaGnathTuggers
import com.lagradost.cloudstream3.extractors.Minoplres
import com.lagradost.cloudstream3.extractors.MixDrop
import com.lagradost.cloudstream3.extractors.MixDropAg
import com.lagradost.cloudstream3.extractors.MixDropBz
import com.lagradost.cloudstream3.extractors.MixDropCh
import com.lagradost.cloudstream3.extractors.MixDropTo
import com.lagradost.cloudstream3.extractors.MixDropPs
import com.lagradost.cloudstream3.extractors.Mdy
import com.lagradost.cloudstream3.extractors.MixDropSi
import com.lagradost.cloudstream3.extractors.MxDropTo
import com.lagradost.cloudstream3.extractors.Movhide
import com.lagradost.cloudstream3.extractors.Moviehab
import com.lagradost.cloudstream3.extractors.MoviehabNet
import com.lagradost.cloudstream3.extractors.Moviesm4u
import com.lagradost.cloudstream3.extractors.Mp4Upload
import com.lagradost.cloudstream3.extractors.Multimovies
import com.lagradost.cloudstream3.extractors.Mvidoo
import com.lagradost.cloudstream3.extractors.MyVidPlay
import com.lagradost.cloudstream3.extractors.Mwish
import com.lagradost.cloudstream3.extractors.NathanFromSubject
import com.lagradost.cloudstream3.extractors.Nekostream
import com.lagradost.cloudstream3.extractors.Nekowish
import com.lagradost.cloudstream3.extractors.Neonime7n
import com.lagradost.cloudstream3.extractors.Neonime8n
import com.lagradost.cloudstream3.extractors.Obeywish
import com.lagradost.cloudstream3.extractors.Odnoklassniki
import com.lagradost.cloudstream3.extractors.OkRuHTTP
import com.lagradost.cloudstream3.extractors.OkRuHTTPMobile
import com.lagradost.cloudstream3.extractors.OkRuSSL
import com.lagradost.cloudstream3.extractors.OkRuSSLMobile
import com.lagradost.cloudstream3.extractors.PeaceMakerst
import com.lagradost.cloudstream3.extractors.Peytonepre
import com.lagradost.cloudstream3.extractors.Pichive
import com.lagradost.cloudstream3.extractors.PixelDrain
import com.lagradost.cloudstream3.extractors.PixelDrainDev
import com.lagradost.cloudstream3.extractors.PlayLtXyz
import com.lagradost.cloudstream3.extractors.PlayRu
import com.lagradost.cloudstream3.extractors.PlayerVoxzer
import com.lagradost.cloudstream3.extractors.Playerwish
import com.lagradost.cloudstream3.extractors.Playmogo
import com.lagradost.cloudstream3.extractors.Rabbitstream
import com.lagradost.cloudstream3.extractors.RapidVid
import com.lagradost.cloudstream3.extractors.Rasacintaku
import com.lagradost.cloudstream3.extractors.SBfull
import com.lagradost.cloudstream3.extractors.Sbasian
import com.lagradost.cloudstream3.extractors.Sbface
import com.lagradost.cloudstream3.extractors.Sbflix
import com.lagradost.cloudstream3.extractors.Sblona
import com.lagradost.cloudstream3.extractors.Sblongvu
import com.lagradost.cloudstream3.extractors.Sbnet
import com.lagradost.cloudstream3.extractors.Sbrapid
import com.lagradost.cloudstream3.extractors.Sbsonic
import com.lagradost.cloudstream3.extractors.Sbspeed
import com.lagradost.cloudstream3.extractors.Sbthe
import com.lagradost.cloudstream3.extractors.SecvideoOnline
import com.lagradost.cloudstream3.extractors.Sendvid
import com.lagradost.cloudstream3.extractors.Server1uns
import com.lagradost.cloudstream3.extractors.SfastwishCom
import com.lagradost.cloudstream3.extractors.ShaveTape
import com.lagradost.cloudstream3.extractors.SibNet
import com.lagradost.cloudstream3.extractors.Simpulumlamerop
import com.lagradost.cloudstream3.extractors.Smoothpre
import com.lagradost.cloudstream3.extractors.Sobreatsesuyp
import com.lagradost.cloudstream3.extractors.Ssbstream
import com.lagradost.cloudstream3.extractors.StreamEmbed
import com.lagradost.cloudstream3.extractors.StreamHLS
import com.lagradost.cloudstream3.extractors.StreamM4u
import com.lagradost.cloudstream3.extractors.StreamSB
import com.lagradost.cloudstream3.extractors.StreamSB1
import com.lagradost.cloudstream3.extractors.StreamSB10
import com.lagradost.cloudstream3.extractors.StreamSB11
import com.lagradost.cloudstream3.extractors.StreamSB2
import com.lagradost.cloudstream3.extractors.StreamSB3
import com.lagradost.cloudstream3.extractors.StreamSB4
import com.lagradost.cloudstream3.extractors.StreamSB5
import com.lagradost.cloudstream3.extractors.StreamSB6
import com.lagradost.cloudstream3.extractors.StreamSB7
import com.lagradost.cloudstream3.extractors.StreamSB8
import com.lagradost.cloudstream3.extractors.StreamSB9
import com.lagradost.cloudstream3.extractors.StreamSilk
import com.lagradost.cloudstream3.extractors.StreamTape
import com.lagradost.cloudstream3.extractors.StreamTapeNet
import com.lagradost.cloudstream3.extractors.StreamTapeXyz
import com.lagradost.cloudstream3.extractors.Watchadsontape
import com.lagradost.cloudstream3.extractors.StreamWishExtractor
import com.lagradost.cloudstream3.extractors.StreamhideCom
import com.lagradost.cloudstream3.extractors.StreamhideTo
import com.lagradost.cloudstream3.extractors.Streamhub2
import com.lagradost.cloudstream3.extractors.Streamix
import com.lagradost.cloudstream3.extractors.Streamlare
import com.lagradost.cloudstream3.extractors.StreamoUpload
import com.lagradost.cloudstream3.extractors.Streamplay
import com.lagradost.cloudstream3.extractors.Streamsss
import com.lagradost.cloudstream3.extractors.Streamup
import com.lagradost.cloudstream3.extractors.Streamwish2
import com.lagradost.cloudstream3.extractors.Strwish
import com.lagradost.cloudstream3.extractors.Strwish2
import com.lagradost.cloudstream3.extractors.Supervideo
import com.lagradost.cloudstream3.extractors.Swdyu
import com.lagradost.cloudstream3.extractors.Swhoi
import com.lagradost.cloudstream3.extractors.TRsTX
import com.lagradost.cloudstream3.extractors.Tantifilm
import com.lagradost.cloudstream3.extractors.TauVideo
import com.lagradost.cloudstream3.extractors.Techinmind
import com.lagradost.cloudstream3.extractors.Tubeless
import com.lagradost.cloudstream3.extractors.Uasopt
import com.lagradost.cloudstream3.extractors.Up4FunTop
import com.lagradost.cloudstream3.extractors.Up4Stream
import com.lagradost.cloudstream3.extractors.Upstream
import com.lagradost.cloudstream3.extractors.UpstreamExtractor
import com.lagradost.cloudstream3.extractors.Uqload
import com.lagradost.cloudstream3.extractors.Uqload1
import com.lagradost.cloudstream3.extractors.Uqload2
import com.lagradost.cloudstream3.extractors.Uqloadcx
import com.lagradost.cloudstream3.extractors.Uqloadbz
import com.lagradost.cloudstream3.extractors.UqloadsXyz
import com.lagradost.cloudstream3.extractors.Urochsunloath
import com.lagradost.cloudstream3.extractors.Userload
import com.lagradost.cloudstream3.extractors.Userscloud
import com.lagradost.cloudstream3.extractors.Uservideo
import com.lagradost.cloudstream3.extractors.Videa
import com.lagradost.cloudstream3.extractors.Vicloud
import com.lagradost.cloudstream3.extractors.VidHidePro
import com.lagradost.cloudstream3.extractors.VidHidePro1
import com.lagradost.cloudstream3.extractors.VidHidePro2
import com.lagradost.cloudstream3.extractors.VidHidePro3
import com.lagradost.cloudstream3.extractors.VidHidePro4
import com.lagradost.cloudstream3.extractors.VidHidePro5
import com.lagradost.cloudstream3.extractors.VidHidePro6
import com.lagradost.cloudstream3.extractors.VidHideHub
import com.lagradost.cloudstream3.extractors.Ryderjet
import com.lagradost.cloudstream3.extractors.VidMoxy
import com.lagradost.cloudstream3.extractors.VidStack
import com.lagradost.cloudstream3.extractors.VideoSeyred
import com.lagradost.cloudstream3.extractors.Videzz
import com.lagradost.cloudstream3.extractors.Vidgomunime
import com.lagradost.cloudstream3.extractors.Vidgomunimesb
import com.lagradost.cloudstream3.extractors.VidhideExtractor
import com.lagradost.cloudstream3.extractors.Vidmoly
import com.lagradost.cloudstream3.extractors.Vidmolyme
import com.lagradost.cloudstream3.extractors.Vidmolyto
import com.lagradost.cloudstream3.extractors.Vidmolybiz
import com.lagradost.cloudstream3.extractors.Vido
import com.lagradost.cloudstream3.extractors.Vidoza
import com.lagradost.cloudstream3.extractors.VinovoSi
import com.lagradost.cloudstream3.extractors.VinovoTo
import com.lagradost.cloudstream3.extractors.VidNest
import com.lagradost.cloudstream3.extractors.Vidara
import com.lagradost.cloudstream3.extractors.Vide0Net
import com.lagradost.cloudstream3.extractors.Vidsonic
import com.lagradost.cloudstream3.extractors.VkExtractor
import com.lagradost.cloudstream3.extractors.Voe
import com.lagradost.cloudstream3.extractors.Voe1
import com.lagradost.cloudstream3.extractors.Vtbe
import com.lagradost.cloudstream3.extractors.Wibufile
import com.lagradost.cloudstream3.extractors.WishembedPro
import com.lagradost.cloudstream3.extractors.Wishfast
import com.lagradost.cloudstream3.extractors.Wishonly
import com.lagradost.cloudstream3.extractors.XStreamCdn
import com.lagradost.cloudstream3.extractors.Xenolyzb
import com.lagradost.cloudstream3.extractors.Yipsu
import com.lagradost.cloudstream3.extractors.YourUpload
import com.lagradost.cloudstream3.extractors.YoutubeExtractor
import com.lagradost.cloudstream3.extractors.YoutubeMobileExtractor
import com.lagradost.cloudstream3.extractors.YoutubeNoCookieExtractor
import com.lagradost.cloudstream3.extractors.YoutubeShortLinkExtractor
import com.lagradost.cloudstream3.extractors.Yufiles
import com.lagradost.cloudstream3.extractors.Yuguaab
import com.lagradost.cloudstream3.extractors.Zplayer
import com.lagradost.cloudstream3.extractors.ZplayerV2
import com.lagradost.cloudstream3.extractors.Ztreamhub
import com.lagradost.cloudstream3.mvvm.logError
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.ensureActive
import me.xdrop.fuzzywuzzy.FuzzySearch
import org.jsoup.Jsoup
import java.net.URI
import java.util.UUID
import kotlin.coroutines.cancellation.CancellationException
/**
* For use in the ConcatenatingMediaSource.
* If features are missing (headers), please report and we can add it.
* @param durationUs use Long.toUs() for easier input
* */
data class PlayListItem(
val url: String,
val durationUs: Long,
)
/**
* Converts Seconds to MicroSeconds, multiplication by 1_000_000
* */
fun Long.toUs(): Long {
return this * 1_000_000
}
/**
* If your site has an unorthodox m3u8-like system where there are multiple smaller videos concatenated
* use this.
* */
@Suppress("DEPRECATION")
data class ExtractorLinkPlayList(
override val source: String,
override val name: String,
val playlist: List<PlayListItem>,
override var referer: String,
override var quality: Int,
override var headers: Map<String, String> = mapOf(),
/** Used for getExtractorVerifierJob() */
override var extractorData: String? = null,
override var type: ExtractorLinkType,
override var audioTracks: List<AudioFile> = emptyList(),
) : ExtractorLink(
source = source,
name = name,
url = "",
referer = referer,
quality = quality,
headers = headers,
extractorData = extractorData,
type = type,
audioTracks = audioTracks
) {
constructor(
source: String,
name: String,
playlist: List<PlayListItem>,
referer: String,
quality: Int,
isM3u8: Boolean = false,
headers: Map<String, String> = mapOf(),
extractorData: String? = null,
) : this(
source = source,
name = name,
playlist = playlist,
referer = referer,
quality = quality,
type = if (isM3u8) ExtractorLinkType.M3U8 else ExtractorLinkType.VIDEO,
headers = headers,
extractorData = extractorData,
)
}
/** Metadata about the file type used for downloads and exoplayer hint,
* if you respond with the wrong one the file will fail to download or be played */
enum class ExtractorLinkType {
/** Single stream of bytes no matter the actual file type */
VIDEO,
/** Split into several .ts files, has support for encrypted m3u8s */
M3U8,
/** Like m3u8 but uses xml, currently no download support */
DASH,
/** No support at the moment */
TORRENT,
/** No support at the moment */
MAGNET;
// See https://www.iana.org/assignments/media-types/media-types.xhtml
fun getMimeType(): String {
return when (this) {
VIDEO -> "video/mp4"
M3U8 -> "application/x-mpegURL"
DASH -> "application/dash+xml"
TORRENT -> "application/x-bittorrent"
MAGNET -> "application/x-bittorrent"
}
}
}
private fun inferTypeFromUrl(url: String): ExtractorLinkType {
val path = try {
URI(url).path
} catch (_: Throwable) {
// don't log magnet links as errors
null
}
return when {
path?.endsWith(".m3u8") == true -> ExtractorLinkType.M3U8
path?.endsWith(".mpd") == true -> ExtractorLinkType.DASH
path?.endsWith(".torrent") == true -> ExtractorLinkType.TORRENT
url.startsWith("magnet:") -> ExtractorLinkType.MAGNET
else -> ExtractorLinkType.VIDEO
}
}
val INFER_TYPE: ExtractorLinkType? = null
/**
* UUID for the ClearKey DRM scheme.
*
*
* ClearKey is supported on Android devices running Android 5.0 (API Level 21) and up.
*/
val CLEARKEY_UUID = UUID(-0x1d8e62a7567a4c37L, 0x781AB030AF78D30EL)
/**
* UUID for the Widevine DRM scheme.
*
*
* Widevine is supported on Android devices running Android 4.3 (API Level 18) and up.
*/
val WIDEVINE_UUID = UUID(-0x121074568629b532L, -0x5c37d8232ae2de13L)
/**
* UUID for the PlayReady DRM scheme.
*
*
* PlayReady is supported on all AndroidTV devices. Note that most other Android devices do not
* provide PlayReady support.
*/
val PLAYREADY_UUID = UUID(-0x65fb0f8667bfbd7aL, -0x546d19a41f77a06bL)
suspend fun newExtractorLink(
source: String,
name: String,
url: String,
type: ExtractorLinkType? = null,
initializer: suspend ExtractorLink.() -> Unit = { }
): ExtractorLink {
@Suppress("DEPRECATION_ERROR")
val builder =
ExtractorLink(
source = source,
name = name,
url = url,
type = type ?: INFER_TYPE
)
builder.initializer()
return builder
}
suspend fun newDrmExtractorLink(
source: String,
name: String,
url: String,
type: ExtractorLinkType? = null,
uuid: UUID,
initializer: suspend DrmExtractorLink.() -> Unit = { }
): DrmExtractorLink {
@Suppress("DEPRECATION_ERROR")
val builder =
DrmExtractorLink(
source = source,
name = name,
url = url,
uuid = uuid,
type = type ?: INFER_TYPE
)
builder.initializer()
return builder
}
/** Class holds extracted DRM media info to be passed to the player.
* @property source Name of the media source, appears on player layout.
* @property name Title of the media, appears on player layout.
* @property url Url string of media file
* @property referer Referer that will be used by network request.
* @property quality Quality of the media file
* @property headers Headers <String, String> map that will be used by network request.
* @property extractorData Used for getExtractorVerifierJob()
* @property type the type of the media, use [INFER_TYPE] if you want to auto infer the type from the url
* @property kid Base64 value of The KID element (Key Id) contains the identifier of the key associated with a license.
* @property key Base64 value of Key to be used to decrypt the media file.
* @property uuid Drm UUID [WIDEVINE_UUID], [PLAYREADY_UUID], [CLEARKEY_UUID] (by default) .. etc
* @property kty Key type "oct" (octet sequence) by default
* @property keyRequestParameters Parameters that will used to request the key.
* @see newDrmExtractorLink
* */
@Suppress("DEPRECATION")
open class DrmExtractorLink private constructor(
override val source: String,
override val name: String,
override val url: String,
override var referer: String,
override var quality: Int,
override var headers: Map<String, String> = mapOf(),
/** Used for getExtractorVerifierJob() */
override var extractorData: String? = null,
override var type: ExtractorLinkType,
open var kid: String? = null,
open var key: String? = null,
open var uuid: UUID,
open var kty: String? = null,
open var keyRequestParameters: HashMap<String, String>,
open var licenseUrl: String? = null,
override var audioTracks: List<AudioFile> = emptyList(),
) : ExtractorLink(
source, name, url, referer, quality, headers, extractorData, type, audioTracks
) {
@Deprecated("Use newDrmExtractorLink", level = DeprecationLevel.ERROR)
constructor(
source: String,
name: String,
url: String,
referer: String? = null,
quality: Int? = null,
/** the type of the media, use INFER_TYPE if you want to auto infer the type from the url */
type: ExtractorLinkType? = INFER_TYPE,
headers: Map<String, String> = mapOf(),
/** Used for getExtractorVerifierJob() */
extractorData: String? = null,
kid: String? = null,
key: String? = null,
uuid: UUID = CLEARKEY_UUID,
kty: String? = "oct",
keyRequestParameters: HashMap<String, String> = hashMapOf(),
licenseUrl: String? = null,
) : this(
source = source,
name = name,
url = url,
referer = referer ?: "",
quality = quality ?: Qualities.Unknown.value,
headers = headers,
extractorData = extractorData,
type = type ?: inferTypeFromUrl(url),
kid = kid,
key = key,
uuid = uuid,
keyRequestParameters = keyRequestParameters,
kty = kty,
licenseUrl = licenseUrl,
)
@Deprecated("Use newDrmExtractorLink", level = DeprecationLevel.ERROR)
constructor(
source: String,
name: String,
url: String,
referer: String,
quality: Int,
/** the type of the media, use INFER_TYPE if you want to auto infer the type from the url */
type: ExtractorLinkType?,
headers: Map<String, String> = mapOf(),
/** Used for getExtractorVerifierJob() */
extractorData: String? = null,
kid: String? = null,
key: String? = null,
uuid: UUID = CLEARKEY_UUID,
kty: String? = "oct",
keyRequestParameters: HashMap<String, String> = hashMapOf(),
licenseUrl: String? = null,
) : this(
source = source,
name = name,
url = url,
referer = referer,
quality = quality,
headers = headers,
extractorData = extractorData,
type = type ?: inferTypeFromUrl(url),
kid = kid,
key = key,
uuid = uuid,
keyRequestParameters = keyRequestParameters,
kty = kty,
licenseUrl = licenseUrl,
)
}
/** Class holds extracted media info to be passed to the player.
* @property source Name of the media source, appears on player layout.
* @property name Title of the media, appears on player layout.
* @property url Url string of media file
* @property referer Referer that will be used by network request.
* @property quality Quality of the media file
* @property headers Headers <String, String> map that will be used by network request.
* @property extractorData Used for getExtractorVerifierJob()
* @property type Extracted link type (Video, M3u8, Dash, Torrent or Magnet)
* @property audioTracks List of separate audio tracks that can be used with this video
* @see newExtractorLink
* */
open class ExtractorLink
@Deprecated("Use newExtractorLink", level = DeprecationLevel.WARNING)
constructor(
open val source: String,
open val name: String,
override val url: String,
override var referer: String,
open var quality: Int,
override var headers: Map<String, String> = mapOf(),
/** Used for getExtractorVerifierJob() */
open var extractorData: String? = null,
open var type: ExtractorLinkType,
/** List of separate audio tracks that can be merged with this video */
open var audioTracks: List<AudioFile> = emptyList(),
) : IDownloadableMinimum {
val isM3u8: Boolean get() = type == ExtractorLinkType.M3U8
val isDash: Boolean get() = type == ExtractorLinkType.DASH
// Cached video size
private var videoSize: Long? = null
/**
* Get video size in bytes with one head request. Only available for ExtractorLinkType.Video
* @param timeoutSeconds timeout of the head request.
*/
suspend fun getVideoSize(timeoutSeconds: Long = 3L): Long? {
// Content-Length is not applicable to other types of formats
if (this.type != ExtractorLinkType.VIDEO) return null
videoSize = videoSize ?: runCatching {
val response =
app.head(this.url, headers = headers, referer = referer, timeout = timeoutSeconds)
response.headers["Content-Length"]?.toLong()
}.getOrNull()
return videoSize
}
@JsonIgnore
fun getAllHeaders(): Map<String, String> {
if (referer.isBlank()) {
return headers
} else if (headers.keys.none { it.equals("referer", ignoreCase = true) }) {
return headers + mapOf("referer" to referer)
}
return headers
}
@Suppress("DEPRECATION")
@Deprecated("Use newExtractorLink", level = DeprecationLevel.ERROR)
constructor(
source: String,
name: String,
url: String,
referer: String? = null,
quality: Int? = null,
/** the type of the media, use INFER_TYPE if you want to auto infer the type from the url */
type: ExtractorLinkType? = INFER_TYPE,
headers: Map<String, String> = mapOf(),
/** Used for getExtractorVerifierJob() */
extractorData: String? = null,
) : this(
source = source,
name = name,
url = url,
referer = referer ?: "",
quality = quality ?: Qualities.Unknown.value,
headers = headers,
extractorData = extractorData,
type = type ?: inferTypeFromUrl(url)
)
@Suppress("DEPRECATION")
@Deprecated("Use newExtractorLink", level = DeprecationLevel.ERROR)
constructor(
source: String,
name: String,
url: String,
referer: String,
quality: Int,
/** the type of the media, use INFER_TYPE if you want to auto infer the type from the url */
type: ExtractorLinkType?,
headers: Map<String, String> = mapOf(),
/** Used for getExtractorVerifierJob() */
extractorData: String? = null,
) : this(
source = source,
name = name,
url = url,
referer = referer,
quality = quality,
headers = headers,
extractorData = extractorData,
type = type ?: inferTypeFromUrl(url)
)
/**
* Old constructor without isDash, allows for backwards compatibility with extensions.
* Should be removed after all extensions have updated their cloudstream.jar
**/
@Suppress("DEPRECATION_ERROR")
@Deprecated("Use newExtractorLink", level = DeprecationLevel.ERROR)
constructor(
source: String,
name: String,
url: String,
referer: String,
quality: Int,
isM3u8: Boolean = false,
headers: Map<String, String> = mapOf(),
/** Used for getExtractorVerifierJob() */
extractorData: String? = null
) : this(source, name, url, referer, quality, isM3u8, headers, extractorData, false)
@Suppress("DEPRECATION")
@Deprecated("Use newExtractorLink", level = DeprecationLevel.ERROR)
constructor(
source: String,
name: String,
url: String,
referer: String,
quality: Int,
isM3u8: Boolean = false,
headers: Map<String, String> = mapOf(),
/** Used for getExtractorVerifierJob() */
extractorData: String? = null,
isDash: Boolean,
) : this(
source = source,
name = name,
url = url,
referer = referer,
quality = quality,
headers = headers,
extractorData = extractorData,
type = if (isDash) ExtractorLinkType.DASH else if (isM3u8) ExtractorLinkType.M3U8 else ExtractorLinkType.VIDEO
)
override fun toString(): String {
return "ExtractorLink(name=$name, url=$url, referer=$referer, type=$type)"
}
}
/**
* Removes https:// and www.
* To match urls regardless of schema, perhaps Uri() can be used?
*/
val schemaStripRegex = Regex("""^(https:|)//(www\.|)""")
enum class Qualities(var value: Int, val defaultPriority: Int) {
Unknown(400, 4),
P144(144, 0), // 144p
P240(240, 2), // 240p
P360(360, 3), // 360p
P480(480, 4), // 480p
P720(720, 5), // 720p
P1080(1080, 6), // 1080p
P1440(1440, 7), // 1440p
P2160(2160, 8); // 4k or 2160p
companion object {
fun getStringByInt(qual: Int?): String {
return when (qual) {
0 -> "Auto"
Unknown.value -> ""
P2160.value -> "4K"
null -> ""
else -> "${qual}p"
}
}
fun getStringByIntFull(quality: Int): String {
return when (quality) {
0 -> "Auto"
Unknown.value -> "Unknown"
P2160.value -> "4K"
else -> "${quality}p"
}
}
}
}
fun getQualityFromName(qualityName: String?): Int {
if (qualityName == null)
return Qualities.Unknown.value
val match = qualityName.lowercase().replace("p", "").trim()
return when (match) {
"4k" -> Qualities.P2160
else -> null
}?.value ?: match.toIntOrNull() ?: Qualities.Unknown.value
}
private val packedRegex = Regex("""eval\(function\(p,a,c,k,e,.*\)\)""")
fun getPacked(string: String): String? {
return packedRegex.find(string)?.value
}
fun getAndUnpack(string: String): String {
val packedText = getPacked(string)
return JsUnpacker(packedText).unpack() ?: string
}
suspend fun unshortenLinkSafe(url: String): String {
return try {
if (ShortLink.isShortLink(url))
ShortLink.unshorten(url)
else url
} catch (e: Exception) {
logError(e)
url
}
}
suspend fun loadExtractor(
url: String,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
return loadExtractor(
url = url,
referer = null,
subtitleCallback = subtitleCallback,
callback = callback
)
}
/**
* Tries to load the appropriate extractor based on link, returns true if any extractor is loaded.
* */
@Throws(CancellationException::class)
suspend fun loadExtractor(
url: String,
referer: String? = null,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
// Ensure this coroutine has not timed out
coroutineScope { ensureActive() }
val currentUrl = unshortenLinkSafe(url)
val compareUrl = currentUrl.lowercase().replace(schemaStripRegex, "")
// Iterate in reverse order so the new registered ExtractorApi takes priority
for (index in extractorApis.lastIndex downTo 0) {
val extractor = extractorApis[index]
if (compareUrl.startsWith(extractor.mainUrl.replace(schemaStripRegex, ""))) {
try {
extractor.getUrl(currentUrl, referer, subtitleCallback, callback)
} catch (e: Exception) {
logError(e)
// Rethrow if we have timed out
if (e is CancellationException) {
throw e
}
}
return true
}
}
// this is to match mirror domains - like example.com, example.net
for (index in extractorApis.lastIndex downTo 0) {
val extractor = extractorApis[index]
if (FuzzySearch.partialRatio(
extractor.mainUrl,
currentUrl
) > 80
) {
try {
extractor.getUrl(currentUrl, referer, subtitleCallback, callback)
} catch (e: Exception) {
logError(e)
// Rethrow if we have timed out
if (e is CancellationException) {
throw e
}
}
return true
}
}
return false
}
val extractorApis: MutableList<ExtractorApi> = arrayListOf(
//AllProvider(),
Mp4Upload(),
StreamTape(),
StreamTapeNet(),
ShaveTape(),
StreamTapeXyz(),
Watchadsontape(),
//mixdrop extractors
MixDropBz(),
MixDropCh(),
MixDropTo(),
MixDropAg(),
MixDrop(),
MixDropPs(),
Mdy(),
MxDropTo(),
MixDropSi(),
XStreamCdn(),
StreamSB(),
Sblona(),
Vidgomunimesb(),
StreamSilk(),
StreamSB1(),
StreamSB2(),
StreamSB3(),
StreamSB4(),
StreamSB5(),
StreamSB6(),
StreamSB7(),
StreamSB8(),
StreamSB9(),
StreamSB10(),
StreamSB11(),
SBfull(),
// Streamhub(), cause Streamhub2() works
Streamhub2(),
Ssbstream(),
Sbthe(),
Vidgomunime(),
Sbflix(),
Streamsss(),
Sbspeed(),
Sbsonic(),
Sbface(),
Sbrapid(),
Lvturbo(),
Fastream(),
Videa(),
FEmbed(),
FeHD(),
Fplayer(),
DBfilm(),
Luxubu(),
LayarKaca(),
Rasacintaku(),
FEnet(),
Kotakajair(),
Cdnplayer(),
// WatchSB(), 'cause StreamSB.kt works
Uqload(),
Uqload1(),
Uqload2(),
Uqloadcx(),
Uqloadbz(),
Evoload(),
Evoload1(),
UpstreamExtractor(),
Odnoklassniki(),
TauVideo(),
SibNet(),
ContentX(),
Hotlinger(),
FourCX(),
PlayRu(),
FourPlayRu(),
Pichive(),
FourPichive(),
HDMomPlayer(),
HDPlayerSystem(),
VideoSeyred(),
PeaceMakerst(),
HDStreamAble(),
RapidVid(),
TRsTX(),
VidMoxy(),
Sobreatsesuyp(),
PixelDrain(),
PixelDrainDev(),