StreamingCommunity 3.3.1__py3-none-any.whl → 3.3.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of StreamingCommunity might be problematic. Click here for more details.
- StreamingCommunity/Api/Site/mediasetinfinity/util/get_license.py +28 -1
- StreamingCommunity/Api/Site/raiplay/site.py +6 -4
- StreamingCommunity/Api/Site/raiplay/util/ScrapeSerie.py +6 -2
- StreamingCommunity/Api/Site/streamingcommunity/site.py +0 -3
- StreamingCommunity/Api/Site/streamingwatch/site.py +0 -3
- StreamingCommunity/Lib/Downloader/DASH/cdm_helpher.py +1 -18
- StreamingCommunity/Lib/Downloader/DASH/downloader.py +18 -14
- StreamingCommunity/Lib/Downloader/HLS/downloader.py +22 -10
- StreamingCommunity/Lib/Downloader/HLS/segments.py +126 -72
- StreamingCommunity/Lib/M3U8/decryptor.py +0 -14
- StreamingCommunity/Lib/M3U8/estimator.py +44 -34
- StreamingCommunity/Lib/TMBD/tmdb.py +0 -12
- StreamingCommunity/Upload/update.py +1 -1
- StreamingCommunity/Upload/version.py +1 -1
- StreamingCommunity/Util/{bento4_installer.py → installer/bento4_install.py} +56 -44
- StreamingCommunity/Util/installer/binary_paths.py +83 -0
- StreamingCommunity/Util/installer/device_install.py +133 -0
- StreamingCommunity/Util/{ffmpeg_installer.py → installer/ffmpeg_install.py} +100 -138
- StreamingCommunity/Util/logger.py +3 -8
- StreamingCommunity/Util/os.py +34 -150
- StreamingCommunity/run.py +2 -3
- {streamingcommunity-3.3.1.dist-info → streamingcommunity-3.3.3.dist-info}/METADATA +295 -532
- {streamingcommunity-3.3.1.dist-info → streamingcommunity-3.3.3.dist-info}/RECORD +27 -28
- StreamingCommunity/Api/Player/ddl.py +0 -82
- StreamingCommunity/Api/Player/maxstream.py +0 -141
- StreamingCommunity/Api/Player/mixdrop.py +0 -146
- {streamingcommunity-3.3.1.dist-info → streamingcommunity-3.3.3.dist-info}/WHEEL +0 -0
- {streamingcommunity-3.3.1.dist-info → streamingcommunity-3.3.3.dist-info}/entry_points.txt +0 -0
- {streamingcommunity-3.3.1.dist-info → streamingcommunity-3.3.3.dist-info}/licenses/LICENSE +0 -0
- {streamingcommunity-3.3.1.dist-info → streamingcommunity-3.3.3.dist-info}/top_level.txt +0 -0
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
StreamingCommunity/__init__.py,sha256=kOpFRfO3jz3gP2QjgPC_G85Z3rsMwMnsNa0POXMnDng,382
|
|
2
2
|
StreamingCommunity/global_search.py,sha256=ip3D0OKNRTXHpe_Wy7v2KM-yNZdnnbG5FOBYSSk6wB8,12401
|
|
3
|
-
StreamingCommunity/run.py,sha256=
|
|
4
|
-
StreamingCommunity/Api/Player/ddl.py,sha256=cPinK99iX4ThvAHLlzcACcnFvM-M_NK0f4imh9PQY1I,2174
|
|
3
|
+
StreamingCommunity/run.py,sha256=dJ58oIeWaO5GZ1_zK0zVUBEwlD1k99YQihi0Y2dCzi0,21070
|
|
5
4
|
StreamingCommunity/Api/Player/hdplayer.py,sha256=uQGU8ZVEk7qwwu1v4fjxScsP2x9NIHc7rRguXB1Fk2c,1942
|
|
6
|
-
StreamingCommunity/Api/Player/maxstream.py,sha256=JlVTCAo9ze0wF2h0eNPYqdorhwK7DPXpmLAyHMnT7-Y,5017
|
|
7
5
|
StreamingCommunity/Api/Player/mediapolisvod.py,sha256=Npm3HHUO5Wav8c2QX9E2c3SSW6d1STJw-kK8kHRF-zo,2403
|
|
8
|
-
StreamingCommunity/Api/Player/mixdrop.py,sha256=rZOE14yFdQM0l7ZNRMzFtOpaedgXUo6gdvoBu24y7IE,5127
|
|
9
6
|
StreamingCommunity/Api/Player/supervideo.py,sha256=AuAA6eXYODJN-ytdvKjqlzZLOHpwx3kwgy1CSiogs-o,5388
|
|
10
7
|
StreamingCommunity/Api/Player/sweetpixel.py,sha256=AAdLSD7ASLuZNiBx6btr8S44WkxtjTiToPhjtgA6HAE,1703
|
|
11
8
|
StreamingCommunity/Api/Player/vixcloud.py,sha256=0DnukAIBqGqTmL9I6JkpAkHLMf1UG1D_J8c7zt6KDmU,6609
|
|
@@ -42,22 +39,22 @@ StreamingCommunity/Api/Site/mediasetinfinity/series.py,sha256=BtZaZmpJ7-tbMPmosR
|
|
|
42
39
|
StreamingCommunity/Api/Site/mediasetinfinity/site.py,sha256=qCpc02RaEzIJll9m3IJOgDLQdU58MnGIXlBY5_GqU84,4374
|
|
43
40
|
StreamingCommunity/Api/Site/mediasetinfinity/util/ScrapeSerie.py,sha256=-zzBI2ugkIXaqlwTfFIMcmzpIXIbQiimRk_j9UVxZ5E,11154
|
|
44
41
|
StreamingCommunity/Api/Site/mediasetinfinity/util/fix_mpd.py,sha256=B7uZfQ8X4p8KsiPVangFSs5rKKKpA3tavjPCdNrqyCc,1712
|
|
45
|
-
StreamingCommunity/Api/Site/mediasetinfinity/util/get_license.py,sha256=
|
|
42
|
+
StreamingCommunity/Api/Site/mediasetinfinity/util/get_license.py,sha256=cD1tnYSd1t_bZzLSHssbRqFfl1cswAxeUAvtoTUyDbU,12745
|
|
46
43
|
StreamingCommunity/Api/Site/raiplay/__init__.py,sha256=ExPwFYzTxyF8giuUb_kNaYgLqsiKdJ2faYhYDmsH6CM,5433
|
|
47
44
|
StreamingCommunity/Api/Site/raiplay/film.py,sha256=Ep1Kcbvm2nZoHvaxW5Qbg4FBl9QZORM-NEi2obhQyos,3029
|
|
48
45
|
StreamingCommunity/Api/Site/raiplay/series.py,sha256=AojsVWqMk_o0i2zGVvXNVDeCUuNaPcyG-QUTtGquYkE,7829
|
|
49
|
-
StreamingCommunity/Api/Site/raiplay/site.py,sha256=
|
|
50
|
-
StreamingCommunity/Api/Site/raiplay/util/ScrapeSerie.py,sha256=
|
|
46
|
+
StreamingCommunity/Api/Site/raiplay/site.py,sha256=LbqMJHfAdXllxfgugjyfX9d_03fxmVidpUk9kmJ_so4,3284
|
|
47
|
+
StreamingCommunity/Api/Site/raiplay/util/ScrapeSerie.py,sha256=LTJs8cngV-WU_CmNVa37U5t7GCo8ofISE3qnenPpWY8,6152
|
|
51
48
|
StreamingCommunity/Api/Site/raiplay/util/get_license.py,sha256=96Q5aSWhtxtmQl2yzylL-1x3jY24UpLLZlEE6YrO_gs,978
|
|
52
49
|
StreamingCommunity/Api/Site/streamingcommunity/__init__.py,sha256=lLQKaDrHyxehXmjpyx7Zf2rLYsBG22xo45rC_4oJhKc,5618
|
|
53
50
|
StreamingCommunity/Api/Site/streamingcommunity/film.py,sha256=aA0tsDc5GCFFkrn_s2QKNcnyBYhK2S5OnDx29P1_rhA,2779
|
|
54
51
|
StreamingCommunity/Api/Site/streamingcommunity/series.py,sha256=eLCeVjur2w2J1PgYzhe8dIJYGZus6YEyQr5H0YXazH4,9055
|
|
55
|
-
StreamingCommunity/Api/Site/streamingcommunity/site.py,sha256=
|
|
52
|
+
StreamingCommunity/Api/Site/streamingcommunity/site.py,sha256=YlrxE1ktC3obpwra8PNBZizZvaYLCh_iHWB_bD-3AaU,3941
|
|
56
53
|
StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py,sha256=b-PWO1fP68yfptLb5X3i4M1PFZHKkqJh32yHgKsoIGs,5684
|
|
57
54
|
StreamingCommunity/Api/Site/streamingwatch/__init__.py,sha256=Nx8fedFHn4Ewy4iFDutyMiTzdYQKhfkJYJ8KlZjBOhg,5583
|
|
58
55
|
StreamingCommunity/Api/Site/streamingwatch/film.py,sha256=B_9z9xzfuqEbzv-eVHuadvOKTcEiHhRU92Gk_f2u7Zs,1693
|
|
59
56
|
StreamingCommunity/Api/Site/streamingwatch/series.py,sha256=nxGef_djMUZLAEDbHG-hbbly0eWagxPm8xu5aFIlSrI,6245
|
|
60
|
-
StreamingCommunity/Api/Site/streamingwatch/site.py,sha256=
|
|
57
|
+
StreamingCommunity/Api/Site/streamingwatch/site.py,sha256=imwsj7Ah6M8PmGFFUmi_A7guSXEI-X5mUH7Qy796kvw,3284
|
|
61
58
|
StreamingCommunity/Api/Site/streamingwatch/util/ScrapeSerie.py,sha256=h28W2Q_cZhBe4v91dvUDYbLBUV98i2Ghb1OOhVq3Iuk,4289
|
|
62
59
|
StreamingCommunity/Api/Template/__init__.py,sha256=fiDHu2yUk3Jk5CWmmnCJNy9fRLbq8RhHB_20NDD12tA,84
|
|
63
60
|
StreamingCommunity/Api/Template/config_loader.py,sha256=2RT_0mqQmWzXM4rYaqss-yhXztYAcfNkTalFPjzv270,2056
|
|
@@ -66,13 +63,13 @@ StreamingCommunity/Api/Template/Class/SearchType.py,sha256=LOlE8UgraEM0UAVeNCThD
|
|
|
66
63
|
StreamingCommunity/Api/Template/Util/__init__.py,sha256=v23VkosPNOQG5XbDkyCx5shEVJvRJffgkAF_Am5zMQc,377
|
|
67
64
|
StreamingCommunity/Api/Template/Util/manage_ep.py,sha256=JMGLj_SJY-K5YuvKISurEYyS-pa9jZ2EA-lshVS73z0,9268
|
|
68
65
|
StreamingCommunity/Lib/Downloader/__init__.py,sha256=Zh92xTvBIEIjNQN22iXItG7_VqiDGbOpO5gOZDBdGxc,288
|
|
69
|
-
StreamingCommunity/Lib/Downloader/DASH/cdm_helpher.py,sha256
|
|
66
|
+
StreamingCommunity/Lib/Downloader/DASH/cdm_helpher.py,sha256=22kh7jvnhU-_mPM_EHgaDxurmAUuOLDc40DrZ2_3MN0,4037
|
|
70
67
|
StreamingCommunity/Lib/Downloader/DASH/decrypt.py,sha256=y3F5zrED-FSQzwE9e5rTl07aWkg76qwFgxtziPpPVuQ,2352
|
|
71
|
-
StreamingCommunity/Lib/Downloader/DASH/downloader.py,sha256=
|
|
68
|
+
StreamingCommunity/Lib/Downloader/DASH/downloader.py,sha256=W37W0X3NyVH0hu94I6qlipa7UvmDr-FQgaVd_DVgxy8,9519
|
|
72
69
|
StreamingCommunity/Lib/Downloader/DASH/parser.py,sha256=QUyYhmu-zI2GieiNZaoOoDVPTclSKXsrdeToAtbC9yI,9858
|
|
73
70
|
StreamingCommunity/Lib/Downloader/DASH/segments.py,sha256=oiip_q3QOY_c17_t66D0m974hyzsQXivhHY5-uE9dlQ,12747
|
|
74
|
-
StreamingCommunity/Lib/Downloader/HLS/downloader.py,sha256=
|
|
75
|
-
StreamingCommunity/Lib/Downloader/HLS/segments.py,sha256=
|
|
71
|
+
StreamingCommunity/Lib/Downloader/HLS/downloader.py,sha256=Q8NEvQ5HtxEhD8ZuCeaDkL6GMrag7uJYyHLoBqiM2t8,22130
|
|
72
|
+
StreamingCommunity/Lib/Downloader/HLS/segments.py,sha256=9ICvzIPgS2RFPb8rvmioc-e5AsT07vAD8d-uC006bZ0,19425
|
|
76
73
|
StreamingCommunity/Lib/Downloader/MP4/downloader.py,sha256=_z61uQVnlfh-ktWYTisfbg_a4C3tpK7MO8HUdgLhTpI,8060
|
|
77
74
|
StreamingCommunity/Lib/Downloader/TOR/downloader.py,sha256=tYOCuKkKDcTIJ-2bGIeplovRkLTdp89i8lUvJs_N9jc,19133
|
|
78
75
|
StreamingCommunity/Lib/FFmpeg/__init__.py,sha256=NZmOXpnc5jvdvjNnHPxvj5bzp0GUuNMXd00Fcy4rQPI,258
|
|
@@ -80,31 +77,33 @@ StreamingCommunity/Lib/FFmpeg/capture.py,sha256=UUBaFK8WLkvqxsElqyEj-JvDvd9zUFZ2
|
|
|
80
77
|
StreamingCommunity/Lib/FFmpeg/command.py,sha256=WNPBgEy9I2JRGbO_c4wZzmu0Knx2tx08V2WCrUgAwpA,12654
|
|
81
78
|
StreamingCommunity/Lib/FFmpeg/util.py,sha256=enx5Z29A4aHkq09iaP80NVMttQn9PZ8ruGe6GvURjGk,9515
|
|
82
79
|
StreamingCommunity/Lib/M3U8/__init__.py,sha256=Zxij4WFCxjwyfswUfBv0oys_o0vQpAL5PoK5TGG_StY,288
|
|
83
|
-
StreamingCommunity/Lib/M3U8/decryptor.py,sha256=
|
|
84
|
-
StreamingCommunity/Lib/M3U8/estimator.py,sha256=
|
|
80
|
+
StreamingCommunity/Lib/M3U8/decryptor.py,sha256=0VPMWbfwP9aEr4Y8OYi-e4o0ucMeCnV9HyuiOWxu_sE,2361
|
|
81
|
+
StreamingCommunity/Lib/M3U8/estimator.py,sha256=5nwoB0ddw9S-2QryshZd0vTNaXpszGJCt5pYNSlumXw,5739
|
|
85
82
|
StreamingCommunity/Lib/M3U8/parser.py,sha256=waHkNErWu-tnIJJvixVNjZ1R7OEtAWZDoTch-yey98M,22485
|
|
86
83
|
StreamingCommunity/Lib/M3U8/url_fixer.py,sha256=0Wd6MsBf8BBQ6mmHFElgCX3UbHAzRzSREmi03yb4gU4,1735
|
|
87
84
|
StreamingCommunity/Lib/TMBD/__init__.py,sha256=TBKZ0zwAUvil2V2AirEPy_Q-M3Ksar2CJsUNt4tpXhk,109
|
|
88
85
|
StreamingCommunity/Lib/TMBD/obj_tmbd.py,sha256=dRSvJFS5yqmsBZcw2wqbStcBtXNjU_3n5czMyremAtU,1187
|
|
89
|
-
StreamingCommunity/Lib/TMBD/tmdb.py,sha256=
|
|
86
|
+
StreamingCommunity/Lib/TMBD/tmdb.py,sha256=QaYOskwBZbSejI0pG8h_pX4_7VNn9-3XZ3Nw6OJiDkI,10256
|
|
90
87
|
StreamingCommunity/TelegramHelp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
91
88
|
StreamingCommunity/TelegramHelp/config.json,sha256=v7FjA4smyLWZxChATewmvxDjJcclOCRZ_BIFPJd8Jvc,1374
|
|
92
89
|
StreamingCommunity/TelegramHelp/telegram_bot.py,sha256=KiurpTrgiUNyMcLfceseaxV4xGegCUSJ8YttSeGXhJM,26429
|
|
93
|
-
StreamingCommunity/Upload/update.py,sha256=
|
|
94
|
-
StreamingCommunity/Upload/version.py,sha256=
|
|
95
|
-
StreamingCommunity/Util/bento4_installer.py,sha256=P5ipziMCvezxan8GUh9vm8B1LXGyHusFVDf842LSwis,6966
|
|
90
|
+
StreamingCommunity/Upload/update.py,sha256=ZSQEqNAGnD1yx-xIr-C0T3_zeQuyiIT0COxSLdb4m-Q,3831
|
|
91
|
+
StreamingCommunity/Upload/version.py,sha256=qgdpFfPlIyXhhI1lX68LqRbRWdemajWaWUZUVbgphHk,171
|
|
96
92
|
StreamingCommunity/Util/color.py,sha256=NvD0Eni-25oOOkY-szCEoc0lGvzQxyL7xhM0RE4EvUM,458
|
|
97
93
|
StreamingCommunity/Util/config_json.py,sha256=vB6o6J5V874_bp9Y87VCCxp2wig0P3vwz4--zVokH4o,28576
|
|
98
|
-
StreamingCommunity/Util/ffmpeg_installer.py,sha256=yRVIPwbh05tZ-duZmXkH0qasLNxaQCAT_E4cTP79Z3c,14890
|
|
99
94
|
StreamingCommunity/Util/headers.py,sha256=RP3A6Gr8UB8VU6uzw_yDOjEKkIFKpi7Gi6_w2ACxE30,292
|
|
100
95
|
StreamingCommunity/Util/http_client.py,sha256=Z9537JZLoaPq3S9dfipe4nrWNL7QOyvxkqUlZHdSo40,6253
|
|
101
|
-
StreamingCommunity/Util/logger.py,sha256=
|
|
96
|
+
StreamingCommunity/Util/logger.py,sha256=jexWdX8G7Sf3k5suyFNYlVXNgjsJjlAP5OrhGEQ8s0A,3069
|
|
102
97
|
StreamingCommunity/Util/message.py,sha256=tstYQ9NxlfWupYkqPrOqOLqrKEb1iG5NsvIMNTUXXvA,1332
|
|
103
|
-
StreamingCommunity/Util/os.py,sha256=
|
|
98
|
+
StreamingCommunity/Util/os.py,sha256=b1lMbwPlHp-BVlsjN8XDmbzQmRrWvFG6HuWkFZVy6Co,12405
|
|
104
99
|
StreamingCommunity/Util/table.py,sha256=xXfgd09oIYSxpJwnnkPZdWJ0DcCihSqxfvYYAEo-YMA,9806
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
streamingcommunity-3.3.
|
|
110
|
-
streamingcommunity-3.3.
|
|
100
|
+
StreamingCommunity/Util/installer/bento4_install.py,sha256=Cinufke4bqASzkpN_UUGXQetIFOklOzVJxNMJ0cSFqE,7428
|
|
101
|
+
StreamingCommunity/Util/installer/binary_paths.py,sha256=-vo1sAavMBCg8u1Bx-CNhUIlWdQ7C2gcT2esVMSpKxs,2470
|
|
102
|
+
StreamingCommunity/Util/installer/device_install.py,sha256=yn4xR34lsE1PNRt0qlzhCTHZT_NibfdDEl4Q--b2pMQ,4459
|
|
103
|
+
StreamingCommunity/Util/installer/ffmpeg_install.py,sha256=iTj6MQRNWOz3mMtPLHnAALD1lwvBmG-LRM4o44bPRnQ,13638
|
|
104
|
+
streamingcommunity-3.3.3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
105
|
+
streamingcommunity-3.3.3.dist-info/METADATA,sha256=ll6xrIgKjdK17THvfXiMwrdj6ZUEsLLeAeORxH6shVc,20148
|
|
106
|
+
streamingcommunity-3.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
107
|
+
streamingcommunity-3.3.3.dist-info/entry_points.txt,sha256=Qph9XYfDC8n4LfDLOSl6gJGlkb9eFb5f-JOr_Wb_5rk,67
|
|
108
|
+
streamingcommunity-3.3.3.dist-info/top_level.txt,sha256=YsOcxKP-WOhWpIWgBlh0coll9XUx7aqmRPT7kmt3fH0,19
|
|
109
|
+
streamingcommunity-3.3.3.dist-info/RECORD,,
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# 14.06.24
|
|
2
|
-
|
|
3
|
-
import logging
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# External libraries
|
|
7
|
-
import httpx
|
|
8
|
-
from bs4 import BeautifulSoup
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Internal utilities
|
|
12
|
-
from StreamingCommunity.Util.config_json import config_manager
|
|
13
|
-
from StreamingCommunity.Util.headers import get_userAgent
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
# Variable
|
|
17
|
-
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|
18
|
-
REQUEST_VERIFY = config_manager.get_bool('REQUESTS', 'verify')
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class VideoSource:
|
|
22
|
-
def __init__(self, url, cookie) -> None:
|
|
23
|
-
"""
|
|
24
|
-
Initializes the VideoSource object with default values.
|
|
25
|
-
"""
|
|
26
|
-
self.headers = {'user-agent': get_userAgent()}
|
|
27
|
-
self.url = url
|
|
28
|
-
self.cookie = cookie
|
|
29
|
-
|
|
30
|
-
def make_request(self, url: str) -> str:
|
|
31
|
-
"""
|
|
32
|
-
Make an HTTP GET request to the provided URL.
|
|
33
|
-
|
|
34
|
-
Parameters:
|
|
35
|
-
- url (str): The URL to make the request to.
|
|
36
|
-
|
|
37
|
-
Returns:
|
|
38
|
-
- str: The response content if successful, None otherwise.
|
|
39
|
-
"""
|
|
40
|
-
try:
|
|
41
|
-
response = httpx.get(
|
|
42
|
-
url=url,
|
|
43
|
-
headers=self.headers,
|
|
44
|
-
cookies=self.cookie,
|
|
45
|
-
timeout=max_timeout,
|
|
46
|
-
verify=REQUEST_VERIFY
|
|
47
|
-
)
|
|
48
|
-
response.raise_for_status()
|
|
49
|
-
|
|
50
|
-
return response.text
|
|
51
|
-
|
|
52
|
-
except Exception as err:
|
|
53
|
-
logging.error(f"An error occurred: {err}")
|
|
54
|
-
|
|
55
|
-
return None
|
|
56
|
-
|
|
57
|
-
def get_playlist(self):
|
|
58
|
-
"""
|
|
59
|
-
Retrieves the playlist URL from the video source.
|
|
60
|
-
|
|
61
|
-
Returns:
|
|
62
|
-
- tuple: The mp4 link if found, None otherwise.
|
|
63
|
-
"""
|
|
64
|
-
try:
|
|
65
|
-
text = self.make_request(self.url)
|
|
66
|
-
|
|
67
|
-
if text:
|
|
68
|
-
soup = BeautifulSoup(text, "html.parser")
|
|
69
|
-
source = soup.find("source")
|
|
70
|
-
|
|
71
|
-
if source:
|
|
72
|
-
mp4_link = source.get("src")
|
|
73
|
-
return mp4_link
|
|
74
|
-
|
|
75
|
-
else:
|
|
76
|
-
logging.error("No <source> tag found in the HTML.")
|
|
77
|
-
|
|
78
|
-
else:
|
|
79
|
-
logging.error("Failed to retrieve content from the URL.")
|
|
80
|
-
|
|
81
|
-
except Exception as e:
|
|
82
|
-
logging.error(f"An error occurred while parsing the playlist: {e}")
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
# 05.07.24
|
|
2
|
-
# NOTE: NOT USED
|
|
3
|
-
|
|
4
|
-
import re
|
|
5
|
-
import logging
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# External libraries
|
|
9
|
-
import httpx
|
|
10
|
-
import jsbeautifier
|
|
11
|
-
from bs4 import BeautifulSoup
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# Internal utilities
|
|
15
|
-
from StreamingCommunity.Util.config_json import config_manager
|
|
16
|
-
from StreamingCommunity.Util.headers import get_userAgent
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# Variable
|
|
20
|
-
MAX_TIMEOUT = config_manager.get_int("REQUESTS", "timeout")
|
|
21
|
-
REQUEST_VERIFY = config_manager.get_bool('REQUESTS', 'verify')
|
|
22
|
-
|
|
23
|
-
class VideoSource:
|
|
24
|
-
def __init__(self, url: str):
|
|
25
|
-
"""
|
|
26
|
-
Sets up the video source with the provided URL.
|
|
27
|
-
|
|
28
|
-
Parameters:
|
|
29
|
-
- url (str): The URL of the video.
|
|
30
|
-
"""
|
|
31
|
-
self.url = url
|
|
32
|
-
self.redirect_url = None
|
|
33
|
-
self.maxstream_url = None
|
|
34
|
-
self.m3u8_url = None
|
|
35
|
-
self.headers = {'user-agent': get_userAgent()}
|
|
36
|
-
|
|
37
|
-
def get_redirect_url(self):
|
|
38
|
-
"""
|
|
39
|
-
Sends a request to the initial URL and extracts the redirect URL.
|
|
40
|
-
"""
|
|
41
|
-
try:
|
|
42
|
-
response = httpx.get(self.url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
|
|
43
|
-
response.raise_for_status()
|
|
44
|
-
|
|
45
|
-
# Extract the redirect URL from the HTML
|
|
46
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
47
|
-
self.redirect_url = soup.find("div", id="iframen1").get("data-src")
|
|
48
|
-
logging.info(f"Redirect URL: {self.redirect_url}")
|
|
49
|
-
|
|
50
|
-
return self.redirect_url
|
|
51
|
-
|
|
52
|
-
except Exception as e:
|
|
53
|
-
logging.error(f"Error parsing HTML: {e}")
|
|
54
|
-
raise
|
|
55
|
-
|
|
56
|
-
def get_maxstream_url(self):
|
|
57
|
-
"""
|
|
58
|
-
Sends a request to the redirect URL and extracts the Maxstream URL.
|
|
59
|
-
"""
|
|
60
|
-
try:
|
|
61
|
-
response = httpx.get(self.redirect_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
|
|
62
|
-
response.raise_for_status()
|
|
63
|
-
|
|
64
|
-
# Extract the Maxstream URL from the HTML
|
|
65
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
66
|
-
maxstream_url = soup.find("a")
|
|
67
|
-
|
|
68
|
-
if maxstream_url is None:
|
|
69
|
-
|
|
70
|
-
# If no anchor tag is found, try the alternative method
|
|
71
|
-
logging.warning("Anchor tag not found. Trying the alternative method.")
|
|
72
|
-
headers = {
|
|
73
|
-
'origin': 'https://stayonline.pro',
|
|
74
|
-
'user-agent': get_userAgent(),
|
|
75
|
-
'x-requested-with': 'XMLHttpRequest',
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
# Make request to stayonline api
|
|
79
|
-
data = {'id': self.redirect_url.split("/")[-2], 'ref': ''}
|
|
80
|
-
response = httpx.post('https://stayonline.pro/ajax/linkEmbedView.php', headers=headers, data=data, verify=REQUEST_VERIFY)
|
|
81
|
-
response.raise_for_status()
|
|
82
|
-
uprot_url = response.json()['data']['value']
|
|
83
|
-
|
|
84
|
-
# Retry getting maxtstream url
|
|
85
|
-
response = httpx.get(uprot_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
|
|
86
|
-
response.raise_for_status()
|
|
87
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
88
|
-
maxstream_url = soup.find("a").get("href")
|
|
89
|
-
|
|
90
|
-
else:
|
|
91
|
-
maxstream_url = maxstream_url.get("href")
|
|
92
|
-
|
|
93
|
-
self.maxstream_url = maxstream_url
|
|
94
|
-
logging.info(f"Maxstream URL: {self.maxstream_url}")
|
|
95
|
-
|
|
96
|
-
return self.maxstream_url
|
|
97
|
-
|
|
98
|
-
except Exception as e:
|
|
99
|
-
logging.error(f"Error during the request: {e}")
|
|
100
|
-
raise
|
|
101
|
-
|
|
102
|
-
def get_m3u8_url(self):
|
|
103
|
-
"""
|
|
104
|
-
Sends a request to the Maxstream URL and extracts the .m3u8 file URL.
|
|
105
|
-
"""
|
|
106
|
-
try:
|
|
107
|
-
response = httpx.get(self.maxstream_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
|
|
108
|
-
response.raise_for_status()
|
|
109
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
110
|
-
|
|
111
|
-
# Iterate over all script tags in the HTML
|
|
112
|
-
for script in soup.find_all("script"):
|
|
113
|
-
if "eval(function(p,a,c,k,e,d)" in script.text:
|
|
114
|
-
|
|
115
|
-
# Execute the script using
|
|
116
|
-
data_js = jsbeautifier.beautify(script.text)
|
|
117
|
-
|
|
118
|
-
# Extract the .m3u8 URL from the script's output
|
|
119
|
-
match = re.search(r'sources:\s*\[\{\s*src:\s*"([^"]+)"', data_js)
|
|
120
|
-
|
|
121
|
-
if match:
|
|
122
|
-
self.m3u8_url = match.group(1)
|
|
123
|
-
logging.info(f"M3U8 URL: {self.m3u8_url}")
|
|
124
|
-
break
|
|
125
|
-
|
|
126
|
-
else:
|
|
127
|
-
logging.error("Failed to find M3U8 URL: No match found")
|
|
128
|
-
|
|
129
|
-
return self.m3u8_url
|
|
130
|
-
|
|
131
|
-
except Exception as e:
|
|
132
|
-
logging.error(f"Error executing the Node.js script: {e}")
|
|
133
|
-
raise
|
|
134
|
-
|
|
135
|
-
def get_playlist(self):
|
|
136
|
-
"""
|
|
137
|
-
Executes the entire flow to obtain the final .m3u8 file URL.
|
|
138
|
-
"""
|
|
139
|
-
self.get_redirect_url()
|
|
140
|
-
self.get_maxstream_url()
|
|
141
|
-
return self.get_m3u8_url()
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
# 05.07.24
|
|
2
|
-
|
|
3
|
-
import re
|
|
4
|
-
import logging
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# External libraries
|
|
8
|
-
import httpx
|
|
9
|
-
import jsbeautifier
|
|
10
|
-
from bs4 import BeautifulSoup
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# Internal utilities
|
|
14
|
-
from StreamingCommunity.Util.config_json import config_manager
|
|
15
|
-
from StreamingCommunity.Util.headers import get_userAgent
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
# Variable
|
|
19
|
-
MAX_TIMEOUT = config_manager.get_int("REQUESTS", "timeout")
|
|
20
|
-
REQUEST_VERIFY = config_manager.get_bool('REQUESTS', 'verify')
|
|
21
|
-
|
|
22
|
-
class VideoSource:
|
|
23
|
-
STAYONLINE_BASE_URL = "https://stayonline.pro"
|
|
24
|
-
MIXDROP_BASE_URL = "https://mixdrop.sb"
|
|
25
|
-
|
|
26
|
-
def __init__(self, url: str):
|
|
27
|
-
self.url = url
|
|
28
|
-
self.redirect_url: str = None
|
|
29
|
-
self._init_headers()
|
|
30
|
-
|
|
31
|
-
def _init_headers(self) -> None:
|
|
32
|
-
"""Initialize the base headers used for requests."""
|
|
33
|
-
self.headers = {
|
|
34
|
-
'origin': self.STAYONLINE_BASE_URL,
|
|
35
|
-
'user-agent': get_userAgent(),
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
def _get_mixdrop_headers(self) -> dict:
|
|
39
|
-
"""Get headers specifically for MixDrop requests."""
|
|
40
|
-
return {
|
|
41
|
-
'referer': 'https://mixdrop.club/',
|
|
42
|
-
'user-agent': get_userAgent()
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
def get_redirect_url(self) -> str:
|
|
46
|
-
"""Extract the stayonline redirect URL from the initial page."""
|
|
47
|
-
try:
|
|
48
|
-
response = httpx.get(self.url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
|
|
49
|
-
response.raise_for_status()
|
|
50
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
51
|
-
|
|
52
|
-
for link in soup.find_all('a'):
|
|
53
|
-
href = link.get('href')
|
|
54
|
-
if href and 'stayonline' in href:
|
|
55
|
-
self.redirect_url = href
|
|
56
|
-
logging.info(f"Redirect URL: {self.redirect_url}")
|
|
57
|
-
return self.redirect_url
|
|
58
|
-
|
|
59
|
-
raise ValueError("Stayonline URL not found")
|
|
60
|
-
|
|
61
|
-
except Exception as e:
|
|
62
|
-
logging.error(f"Error getting redirect URL: {e}")
|
|
63
|
-
raise
|
|
64
|
-
|
|
65
|
-
def get_link_id(self) -> str:
|
|
66
|
-
"""Extract the link ID from the redirect page."""
|
|
67
|
-
if not self.redirect_url:
|
|
68
|
-
raise ValueError("Redirect URL not set. Call get_redirect_url first.")
|
|
69
|
-
|
|
70
|
-
try:
|
|
71
|
-
response = httpx.get(self.redirect_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
|
|
72
|
-
response.raise_for_status()
|
|
73
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
74
|
-
|
|
75
|
-
for script in soup.find_all('script'):
|
|
76
|
-
match = re.search(r'var\s+linkId\s*=\s*"([^"]+)"', script.text)
|
|
77
|
-
if match:
|
|
78
|
-
return match.group(1)
|
|
79
|
-
|
|
80
|
-
raise ValueError("LinkId not found")
|
|
81
|
-
|
|
82
|
-
except Exception as e:
|
|
83
|
-
logging.error(f"Error getting link ID: {e}")
|
|
84
|
-
raise
|
|
85
|
-
|
|
86
|
-
def get_final_url(self, link_id: str) -> str:
|
|
87
|
-
"""Get the final URL using the link ID."""
|
|
88
|
-
try:
|
|
89
|
-
self.headers['referer'] = f'{self.STAYONLINE_BASE_URL}/l/{link_id}/'
|
|
90
|
-
data = {'id': link_id, 'ref': ''}
|
|
91
|
-
|
|
92
|
-
response = httpx.post(f'{self.STAYONLINE_BASE_URL}/ajax/linkView.php', headers=self.headers, data=data, timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
|
|
93
|
-
response.raise_for_status()
|
|
94
|
-
return response.json()['data']['value']
|
|
95
|
-
|
|
96
|
-
except Exception as e:
|
|
97
|
-
logging.error(f"Error getting final URL: {e}")
|
|
98
|
-
raise
|
|
99
|
-
|
|
100
|
-
def _extract_video_id(self, final_url: str) -> str:
|
|
101
|
-
"""Extract video ID from the final URL."""
|
|
102
|
-
parts = final_url.split('/')
|
|
103
|
-
if len(parts) < 5:
|
|
104
|
-
raise ValueError("Invalid final URL format")
|
|
105
|
-
return parts[4]
|
|
106
|
-
|
|
107
|
-
def _extract_delivery_url(self, script_text: str) -> str:
|
|
108
|
-
"""Extract delivery URL from beautified JavaScript."""
|
|
109
|
-
beautified = jsbeautifier.beautify(script_text)
|
|
110
|
-
for line in beautified.splitlines():
|
|
111
|
-
if 'MDCore.wurl' in line:
|
|
112
|
-
url = line.split('= ')[1].strip('"').strip(';')
|
|
113
|
-
return f"https:{url}"
|
|
114
|
-
raise ValueError("Delivery URL not found in script")
|
|
115
|
-
|
|
116
|
-
def get_playlist(self) -> str:
|
|
117
|
-
"""
|
|
118
|
-
Execute the entire flow to obtain the final video URL.
|
|
119
|
-
Returns:
|
|
120
|
-
str: The final video delivery URL
|
|
121
|
-
"""
|
|
122
|
-
self.get_redirect_url()
|
|
123
|
-
link_id = self.get_link_id()
|
|
124
|
-
|
|
125
|
-
final_url = self.get_final_url(link_id)
|
|
126
|
-
video_id = self._extract_video_id(final_url)
|
|
127
|
-
|
|
128
|
-
response = httpx.get(
|
|
129
|
-
f'{self.MIXDROP_BASE_URL}/e/{video_id}',
|
|
130
|
-
headers=self._get_mixdrop_headers(),
|
|
131
|
-
timeout=MAX_TIMEOUT,
|
|
132
|
-
verify=REQUEST_VERIFY
|
|
133
|
-
)
|
|
134
|
-
response.raise_for_status()
|
|
135
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
136
|
-
|
|
137
|
-
script_text = next(
|
|
138
|
-
(script.text for script in soup.find_all('script')
|
|
139
|
-
if "eval" in str(script.text)),
|
|
140
|
-
None
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
if not script_text:
|
|
144
|
-
raise ValueError("Required script not found")
|
|
145
|
-
|
|
146
|
-
return self._extract_delivery_url(script_text).replace('"', '')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|