Skip to content

Commit bd922af

Browse files
committed
Bump v3.0.1
1 parent 33436ec commit bd922af

File tree

7 files changed

+17
-230
lines changed

7 files changed

+17
-230
lines changed

StreamingCommunity/Api/Site/1337xx/site.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def title_search(query: str) -> int:
5858
# Create soup and find table
5959
soup = BeautifulSoup(response.text, "html.parser")
6060

61-
for tr in soup.find_all('tr'):
61+
for i, tr in enumerate(soup.find_all('tr')):
6262
try:
6363

6464
title_info = {
@@ -72,6 +72,9 @@ def title_search(query: str) -> int:
7272
}
7373
media_search_manager.add_media(title_info)
7474

75+
if i == 20:
76+
break
77+
7578
except Exception as e:
7679
print(f"Error parsing a film entry: {e}")
7780

StreamingCommunity/Api/Site/cb01new/__init__.py

Lines changed: 0 additions & 71 deletions
This file was deleted.

StreamingCommunity/Api/Site/cb01new/film.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

StreamingCommunity/Api/Site/cb01new/site.py

Lines changed: 0 additions & 81 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = 'StreamingCommunity'
2-
__version__ = '3.0.0'
2+
__version__ = '3.0.1'
33
__author__ = 'Arrowar'
44
__description__ = 'A command-line program to download film'
55
__copyright__ = 'Copyright 2024'

StreamingCommunity/Util/config_json.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
from rich.console import Console
1313

1414

15+
# Internal utilities
16+
from StreamingCommunity.Util.headers import get_userAgent
17+
18+
1519
# Variable
1620
console = Console()
1721
download_site_data = True
@@ -134,7 +138,7 @@ def _download_reference_config(self) -> None:
134138
console.print(f"[bold cyan]Downloading reference configuration:[/bold cyan] [green]{self.reference_config_url}[/green]")
135139

136140
try:
137-
response = requests.get(self.reference_config_url, timeout=10)
141+
response = requests.get(self.reference_config_url, timeout=8, headers={'User-Agent': get_userAgent()})
138142

139143
if response.status_code == 200:
140144
with open(self.file_path, 'wb') as f:
@@ -156,7 +160,7 @@ def _validate_and_update_config(self) -> None:
156160
try:
157161
# Download the reference configuration
158162
console.print(f"[bold cyan]Validating configuration with GitHub...[/bold cyan]")
159-
response = requests.get(self.reference_config_url, timeout=10)
163+
response = requests.get(self.reference_config_url, timeout=8, headers={'User-Agent': get_userAgent()})
160164

161165
if not response.ok:
162166
raise Exception(f"Error downloading reference configuration. Code: {response.status_code}")
@@ -267,13 +271,14 @@ def _load_site_data_from_api(self) -> None:
267271
headers = {
268272
"apikey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp2Zm5ncG94d3Jnc3duenl0YWRoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDAxNTIxNjMsImV4cCI6MjA1NTcyODE2M30.FNTCCMwi0QaKjOu8gtZsT5yQttUW8QiDDGXmzkn89QE",
269273
"Authorization": f"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp2Zm5ncG94d3Jnc3duenl0YWRoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDAxNTIxNjMsImV4cCI6MjA1NTcyODE2M30.FNTCCMwi0QaKjOu8gtZsT5yQttUW8QiDDGXmzkn89QE",
270-
"Content-Type": "application/json"
274+
"Content-Type": "application/json",
275+
"User-Agent": get_userAgent()
271276
}
272277

273278
try:
274279
console.print("[bold cyan]Retrieving site data from API...[/bold cyan]")
275-
response = requests.get("https://zvfngpoxwrgswnzytadh.supabase.co/rest/v1/public", headers=headers, timeout=10)
276-
280+
response = requests.get("https://zvfngpoxwrgswnzytadh.supabase.co/rest/v1/public", timeout=8, headers=headers)
281+
277282
if response.ok:
278283
data = response.json()
279284
if data and len(data) > 0:
@@ -282,13 +287,6 @@ def _load_site_data_from_api(self) -> None:
282287
site_count = len(self.configSite) if isinstance(self.configSite, dict) else 0
283288
console.print(f"[bold green]Site data retrieved:[/bold green] {site_count} streaming services available")
284289

285-
# Show some sites as examples
286-
if site_count > 0:
287-
examples = list(self.configSite.items())[:3]
288-
sites_info = []
289-
for site, info in examples:
290-
url = info.get('full_url', 'N/A')
291-
console.print(f" • [cyan]{site}[/cyan]: {url}")
292290
else:
293291
console.print("[bold yellow]API returned an empty data set[/bold yellow]")
294292
else:
@@ -347,7 +345,7 @@ def download_file(self, url: str, filename: str) -> None:
347345
try:
348346
logging.info(f"Downloading {filename} from {url}...")
349347
console.print(f"[bold cyan]File download:[/bold cyan] {os.path.basename(filename)}")
350-
response = requests.get(url, timeout=10)
348+
response = requests.get(url, timeout=8, headers={'User-Agent': get_userAgent()})
351349

352350
if response.status_code == 200:
353351
with open(filename, 'wb') as f:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def read_readme():
1010

1111
setup(
1212
name="StreamingCommunity",
13-
version="3.0.0",
13+
version="3.0.1",
1414
long_description=read_readme(),
1515
long_description_content_type="text/markdown",
1616
author="Lovi-0",

0 commit comments

Comments
 (0)