StreamingCommunity 1.8.0__py3-none-any.whl → 1.9.2__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/run.py +18 -13
- {StreamingCommunity-1.8.0.dist-info → StreamingCommunity-1.9.2.dist-info}/METADATA +157 -63
- StreamingCommunity-1.9.2.dist-info/RECORD +7 -0
- {StreamingCommunity-1.8.0.dist-info → StreamingCommunity-1.9.2.dist-info}/WHEEL +1 -1
- {StreamingCommunity-1.8.0.dist-info → StreamingCommunity-1.9.2.dist-info}/entry_points.txt +1 -0
- StreamingCommunity/Src/Api/Player/Helper/Vixcloud/js_parser.py +0 -143
- StreamingCommunity/Src/Api/Player/Helper/Vixcloud/util.py +0 -166
- StreamingCommunity/Src/Api/Player/ddl.py +0 -89
- StreamingCommunity/Src/Api/Player/maxstream.py +0 -151
- StreamingCommunity/Src/Api/Player/supervideo.py +0 -194
- StreamingCommunity/Src/Api/Player/vixcloud.py +0 -224
- StreamingCommunity/Src/Api/Site/1337xx/__init__.py +0 -50
- StreamingCommunity/Src/Api/Site/1337xx/costant.py +0 -15
- StreamingCommunity/Src/Api/Site/1337xx/site.py +0 -84
- StreamingCommunity/Src/Api/Site/1337xx/title.py +0 -66
- StreamingCommunity/Src/Api/Site/altadefinizione/__init__.py +0 -50
- StreamingCommunity/Src/Api/Site/altadefinizione/costant.py +0 -15
- StreamingCommunity/Src/Api/Site/altadefinizione/film.py +0 -69
- StreamingCommunity/Src/Api/Site/altadefinizione/site.py +0 -86
- StreamingCommunity/Src/Api/Site/animeunity/__init__.py +0 -50
- StreamingCommunity/Src/Api/Site/animeunity/anime.py +0 -126
- StreamingCommunity/Src/Api/Site/animeunity/costant.py +0 -15
- StreamingCommunity/Src/Api/Site/animeunity/film_serie.py +0 -131
- StreamingCommunity/Src/Api/Site/animeunity/site.py +0 -165
- StreamingCommunity/Src/Api/Site/animeunity/util/ScrapeSerie.py +0 -97
- StreamingCommunity/Src/Api/Site/bitsearch/__init__.py +0 -51
- StreamingCommunity/Src/Api/Site/bitsearch/costant.py +0 -15
- StreamingCommunity/Src/Api/Site/bitsearch/site.py +0 -84
- StreamingCommunity/Src/Api/Site/bitsearch/title.py +0 -47
- StreamingCommunity/Src/Api/Site/cb01new/__init__.py +0 -51
- StreamingCommunity/Src/Api/Site/cb01new/costant.py +0 -15
- StreamingCommunity/Src/Api/Site/cb01new/film.py +0 -69
- StreamingCommunity/Src/Api/Site/cb01new/site.py +0 -74
- StreamingCommunity/Src/Api/Site/ddlstreamitaly/Player/ScrapeSerie.py +0 -83
- StreamingCommunity/Src/Api/Site/ddlstreamitaly/__init__.py +0 -57
- StreamingCommunity/Src/Api/Site/ddlstreamitaly/costant.py +0 -16
- StreamingCommunity/Src/Api/Site/ddlstreamitaly/series.py +0 -142
- StreamingCommunity/Src/Api/Site/ddlstreamitaly/site.py +0 -93
- StreamingCommunity/Src/Api/Site/ddlstreamitaly/util/ScrapeSerie.py +0 -83
- StreamingCommunity/Src/Api/Site/guardaserie/Player/ScrapeSerie.py +0 -110
- StreamingCommunity/Src/Api/Site/guardaserie/__init__.py +0 -52
- StreamingCommunity/Src/Api/Site/guardaserie/costant.py +0 -15
- StreamingCommunity/Src/Api/Site/guardaserie/series.py +0 -195
- StreamingCommunity/Src/Api/Site/guardaserie/site.py +0 -84
- StreamingCommunity/Src/Api/Site/guardaserie/util/ScrapeSerie.py +0 -110
- StreamingCommunity/Src/Api/Site/mostraguarda/__init__.py +0 -48
- StreamingCommunity/Src/Api/Site/mostraguarda/costant.py +0 -15
- StreamingCommunity/Src/Api/Site/mostraguarda/film.py +0 -94
- StreamingCommunity/Src/Api/Site/piratebays/__init__.py +0 -50
- StreamingCommunity/Src/Api/Site/piratebays/costant.py +0 -15
- StreamingCommunity/Src/Api/Site/piratebays/site.py +0 -89
- StreamingCommunity/Src/Api/Site/piratebays/title.py +0 -45
- StreamingCommunity/Src/Api/Site/streamingcommunity/__init__.py +0 -55
- StreamingCommunity/Src/Api/Site/streamingcommunity/costant.py +0 -15
- StreamingCommunity/Src/Api/Site/streamingcommunity/film.py +0 -70
- StreamingCommunity/Src/Api/Site/streamingcommunity/series.py +0 -203
- StreamingCommunity/Src/Api/Site/streamingcommunity/site.py +0 -126
- StreamingCommunity/Src/Api/Site/streamingcommunity/util/ScrapeSerie.py +0 -113
- StreamingCommunity/Src/Api/Template/Class/SearchType.py +0 -101
- StreamingCommunity/Src/Api/Template/Util/__init__.py +0 -5
- StreamingCommunity/Src/Api/Template/Util/get_domain.py +0 -137
- StreamingCommunity/Src/Api/Template/Util/manage_ep.py +0 -153
- StreamingCommunity/Src/Api/Template/Util/recall_search.py +0 -37
- StreamingCommunity/Src/Api/Template/__init__.py +0 -3
- StreamingCommunity/Src/Api/Template/site.py +0 -87
- StreamingCommunity/Src/Lib/Downloader/HLS/downloader.py +0 -968
- StreamingCommunity/Src/Lib/Downloader/HLS/proxyes.py +0 -110
- StreamingCommunity/Src/Lib/Downloader/HLS/segments.py +0 -540
- StreamingCommunity/Src/Lib/Downloader/MP4/downloader.py +0 -156
- StreamingCommunity/Src/Lib/Downloader/TOR/downloader.py +0 -222
- StreamingCommunity/Src/Lib/Downloader/__init__.py +0 -5
- StreamingCommunity/Src/Lib/Driver/driver_1.py +0 -76
- StreamingCommunity/Src/Lib/FFmpeg/__init__.py +0 -4
- StreamingCommunity/Src/Lib/FFmpeg/capture.py +0 -170
- StreamingCommunity/Src/Lib/FFmpeg/command.py +0 -292
- StreamingCommunity/Src/Lib/FFmpeg/util.py +0 -242
- StreamingCommunity/Src/Lib/M3U8/__init__.py +0 -6
- StreamingCommunity/Src/Lib/M3U8/decryptor.py +0 -129
- StreamingCommunity/Src/Lib/M3U8/estimator.py +0 -173
- StreamingCommunity/Src/Lib/M3U8/parser.py +0 -666
- StreamingCommunity/Src/Lib/M3U8/url_fixer.py +0 -52
- StreamingCommunity/Src/Lib/TMBD/__init__.py +0 -2
- StreamingCommunity/Src/Lib/TMBD/obj_tmbd.py +0 -39
- StreamingCommunity/Src/Lib/TMBD/tmdb.py +0 -346
- StreamingCommunity/Src/Upload/update.py +0 -64
- StreamingCommunity/Src/Upload/version.py +0 -5
- StreamingCommunity/Src/Util/_jsonConfig.py +0 -204
- StreamingCommunity/Src/Util/call_stack.py +0 -42
- StreamingCommunity/Src/Util/color.py +0 -20
- StreamingCommunity/Src/Util/console.py +0 -12
- StreamingCommunity/Src/Util/headers.py +0 -147
- StreamingCommunity/Src/Util/logger.py +0 -53
- StreamingCommunity/Src/Util/message.py +0 -46
- StreamingCommunity/Src/Util/os.py +0 -417
- StreamingCommunity/Src/Util/table.py +0 -163
- StreamingCommunity-1.8.0.dist-info/RECORD +0 -97
- {StreamingCommunity-1.8.0.dist-info → StreamingCommunity-1.9.2.dist-info}/LICENSE +0 -0
- {StreamingCommunity-1.8.0.dist-info → StreamingCommunity-1.9.2.dist-info}/top_level.txt +0 -0
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
# 20.02.24
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import time
|
|
5
|
-
import logging
|
|
6
|
-
import threading
|
|
7
|
-
from collections import deque
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# External libraries
|
|
11
|
-
import psutil
|
|
12
|
-
from tqdm import tqdm
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
# Internal utilities
|
|
16
|
-
from StreamingCommunity.Src.Util.color import Colors
|
|
17
|
-
from StreamingCommunity.Src.Util.os import internet_manager
|
|
18
|
-
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# Variable
|
|
22
|
-
TQDM_USE_LARGE_BAR = config_manager.get_int('M3U8_DOWNLOAD', 'tqdm_use_large_bar')
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class M3U8_Ts_Estimator:
|
|
26
|
-
def __init__(self, total_segments: int):
|
|
27
|
-
"""
|
|
28
|
-
Initialize the M3U8_Ts_Estimator object.
|
|
29
|
-
|
|
30
|
-
Parameters:
|
|
31
|
-
- total_segments (int): Length of total segments to download.
|
|
32
|
-
"""
|
|
33
|
-
self.ts_file_sizes = []
|
|
34
|
-
self.now_downloaded_size = 0
|
|
35
|
-
self.total_segments = total_segments
|
|
36
|
-
self.lock = threading.Lock()
|
|
37
|
-
self.speed = {"upload": "N/A", "download": "N/A"} # Default to N/A
|
|
38
|
-
self.speed_thread = threading.Thread(target=self.capture_speed)
|
|
39
|
-
self.speed_thread.daemon = True
|
|
40
|
-
self.speed_thread.start()
|
|
41
|
-
|
|
42
|
-
def add_ts_file(self, size: int, size_download: int, duration: float):
|
|
43
|
-
"""
|
|
44
|
-
Add a file size to the list of file sizes.
|
|
45
|
-
|
|
46
|
-
Parameters:
|
|
47
|
-
- size (int): The size of the ts file to be added.
|
|
48
|
-
- size_download (int): Single size of the ts file.
|
|
49
|
-
- duration (float): Time to download segment file.
|
|
50
|
-
"""
|
|
51
|
-
if size <= 0 or size_download <= 0 or duration <= 0:
|
|
52
|
-
logging.error("Invalid input values: size=%d, size_download=%d, duration=%f", size, size_download, duration)
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
# Add total size bytes
|
|
56
|
-
self.ts_file_sizes.append(size)
|
|
57
|
-
self.now_downloaded_size += size_download
|
|
58
|
-
|
|
59
|
-
def capture_speed(self, interval: float = 1):
|
|
60
|
-
"""
|
|
61
|
-
Capture the internet speed periodically and store the values.
|
|
62
|
-
"""
|
|
63
|
-
def get_network_io():
|
|
64
|
-
"""Get network I/O counters, handle missing psutil gracefully."""
|
|
65
|
-
try:
|
|
66
|
-
io_counters = psutil.net_io_counters()
|
|
67
|
-
return io_counters
|
|
68
|
-
except Exception as e:
|
|
69
|
-
logging.warning(f"Unable to access network I/O counters: {e}")
|
|
70
|
-
return None
|
|
71
|
-
|
|
72
|
-
while True:
|
|
73
|
-
old_value = get_network_io()
|
|
74
|
-
if old_value is None: # If psutil is not available, continue with default values
|
|
75
|
-
time.sleep(interval)
|
|
76
|
-
continue
|
|
77
|
-
|
|
78
|
-
time.sleep(interval)
|
|
79
|
-
new_value = get_network_io()
|
|
80
|
-
if new_value is None: # Handle again if psutil fails in the next call
|
|
81
|
-
time.sleep(interval)
|
|
82
|
-
continue
|
|
83
|
-
|
|
84
|
-
with self.lock:
|
|
85
|
-
upload_speed = (new_value.bytes_sent - old_value.bytes_sent) / interval
|
|
86
|
-
download_speed = (new_value.bytes_recv - old_value.bytes_recv) / interval
|
|
87
|
-
|
|
88
|
-
self.speed = {
|
|
89
|
-
"upload": internet_manager.format_transfer_speed(upload_speed),
|
|
90
|
-
"download": internet_manager.format_transfer_speed(download_speed)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
def get_average_speed(self) -> float:
|
|
94
|
-
"""
|
|
95
|
-
Calculate the average internet speed.
|
|
96
|
-
|
|
97
|
-
Returns:
|
|
98
|
-
float: The average internet speed in Mbps.
|
|
99
|
-
"""
|
|
100
|
-
with self.lock:
|
|
101
|
-
return self.speed['download'].split(" ")
|
|
102
|
-
|
|
103
|
-
def calculate_total_size(self) -> str:
|
|
104
|
-
"""
|
|
105
|
-
Calculate the total size of the files.
|
|
106
|
-
|
|
107
|
-
Returns:
|
|
108
|
-
str: The mean size of the files in a human-readable format.
|
|
109
|
-
"""
|
|
110
|
-
try:
|
|
111
|
-
if len(self.ts_file_sizes) == 0:
|
|
112
|
-
raise ValueError("No file sizes available to calculate total size.")
|
|
113
|
-
|
|
114
|
-
total_size = sum(self.ts_file_sizes)
|
|
115
|
-
mean_size = total_size / len(self.ts_file_sizes)
|
|
116
|
-
|
|
117
|
-
# Return formatted mean size
|
|
118
|
-
return internet_manager.format_file_size(mean_size)
|
|
119
|
-
|
|
120
|
-
except ZeroDivisionError as e:
|
|
121
|
-
logging.error("Division by zero error occurred: %s", e)
|
|
122
|
-
return "0B"
|
|
123
|
-
|
|
124
|
-
except Exception as e:
|
|
125
|
-
logging.error("An unexpected error occurred: %s", e)
|
|
126
|
-
return "Error"
|
|
127
|
-
|
|
128
|
-
def get_downloaded_size(self) -> str:
|
|
129
|
-
"""
|
|
130
|
-
Get the total downloaded size formatted as a human-readable string.
|
|
131
|
-
|
|
132
|
-
Returns:
|
|
133
|
-
str: The total downloaded size as a human-readable string.
|
|
134
|
-
"""
|
|
135
|
-
return internet_manager.format_file_size(self.now_downloaded_size)
|
|
136
|
-
|
|
137
|
-
def update_progress_bar(self, total_downloaded: int, duration: float, progress_counter: tqdm) -> None:
|
|
138
|
-
"""
|
|
139
|
-
Updates the progress bar with information about the TS segment download.
|
|
140
|
-
|
|
141
|
-
Parameters:
|
|
142
|
-
total_downloaded (int): The length of the content of the downloaded TS segment.
|
|
143
|
-
duration (float): The duration of the segment download in seconds.
|
|
144
|
-
progress_counter (tqdm): The tqdm object representing the progress bar.
|
|
145
|
-
"""
|
|
146
|
-
# Add the size of the downloaded segment to the estimator
|
|
147
|
-
self.add_ts_file(total_downloaded * self.total_segments, total_downloaded, duration)
|
|
148
|
-
|
|
149
|
-
# Get downloaded size and total estimated size
|
|
150
|
-
downloaded_file_size_str = self.get_downloaded_size()
|
|
151
|
-
file_total_size = self.calculate_total_size()
|
|
152
|
-
|
|
153
|
-
# Fix parameter for prefix
|
|
154
|
-
number_file_downloaded = downloaded_file_size_str.split(' ')[0]
|
|
155
|
-
number_file_total_size = file_total_size.split(' ')[0]
|
|
156
|
-
units_file_downloaded = downloaded_file_size_str.split(' ')[1]
|
|
157
|
-
units_file_total_size = file_total_size.split(' ')[1]
|
|
158
|
-
|
|
159
|
-
average_internet_speed = self.get_average_speed()[0]
|
|
160
|
-
average_internet_unit = self.get_average_speed()[1]
|
|
161
|
-
|
|
162
|
-
# Update the progress bar's postfix
|
|
163
|
-
if TQDM_USE_LARGE_BAR:
|
|
164
|
-
progress_counter.set_postfix_str(
|
|
165
|
-
f"{Colors.WHITE}[ {Colors.GREEN}{number_file_downloaded} {Colors.WHITE}< {Colors.GREEN}{number_file_total_size} {Colors.RED}{units_file_total_size} "
|
|
166
|
-
f"{Colors.WHITE}| {Colors.CYAN}{average_internet_speed} {Colors.RED}{average_internet_unit}"
|
|
167
|
-
)
|
|
168
|
-
else:
|
|
169
|
-
progress_counter.set_postfix_str(
|
|
170
|
-
f"{Colors.WHITE}[ {Colors.GREEN}{number_file_downloaded}{Colors.RED} {units_file_downloaded} "
|
|
171
|
-
f"{Colors.WHITE}| {Colors.CYAN}{average_internet_speed} {Colors.RED}{average_internet_unit}"
|
|
172
|
-
)
|
|
173
|
-
|