Skip to content

Commit bea0055

Browse files
committed
Switch to FULL_URL
1 parent 774dc94 commit bea0055

File tree

28 files changed

+250
-645
lines changed

28 files changed

+250
-645
lines changed

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
shell: pwsh
8585
run: |
8686
pyinstaller --onefile --hidden-import=pycryptodomex --hidden-import=ua_generator `
87-
--hidden-import=qbittorrentapi --hidden-import=qbittorrent --hidden-import=googlesearch `
87+
--hidden-import=qbittorrentapi --hidden-import=qbittorrent `
8888
--hidden-import=bs4 --hidden-import=httpx --hidden-import=rich --hidden-import=tqdm `
8989
--hidden-import=m3u8 --hidden-import=psutil --hidden-import=unidecode `
9090
--hidden-import=jsbeautifier --hidden-import=pathvalidate `
@@ -99,7 +99,7 @@ jobs:
9999
if: matrix.os == 'ubuntu-latest'
100100
run: |
101101
pyinstaller --onefile --hidden-import=pycryptodomex --hidden-import=ua_generator \
102-
--hidden-import=qbittorrentapi --hidden-import=qbittorrent --hidden-import=googlesearch \
102+
--hidden-import=qbittorrentapi --hidden-import=qbittorrent \
103103
--hidden-import=bs4 --hidden-import=httpx --hidden-import=rich --hidden-import=tqdm \
104104
--hidden-import=m3u8 --hidden-import=psutil --hidden-import=unidecode \
105105
--hidden-import=jsbeautifier --hidden-import=pathvalidate \
@@ -114,7 +114,7 @@ jobs:
114114
if: matrix.os == 'macos-latest'
115115
run: |
116116
pyinstaller --onefile --hidden-import=pycryptodomex --hidden-import=ua_generator \
117-
--hidden-import=qbittorrentapi --hidden-import=qbittorrent --hidden-import=googlesearch \
117+
--hidden-import=qbittorrentapi --hidden-import=qbittorrent \
118118
--hidden-import=bs4 --hidden-import=httpx --hidden-import=rich --hidden-import=tqdm \
119119
--hidden-import=m3u8 --hidden-import=psutil --hidden-import=unidecode \
120120
--hidden-import=jsbeautifier --hidden-import=pathvalidate \

README.md

+32-21
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131

3232
# 📋 Table of Contents
3333

34-
- 🌐 [Website available](#website-status)
34+
- 🌐 [Website available](https://www.npoint.io/docs/e67633acc3816cc70132)
35+
- 🔄 [Update Domains](#update-domains)
3536
- 🛠️ [Installation](#installation)
3637
- 📦 [PyPI Installation](#1-pypi-installation)
3738
- 🔄 [Automatic Installation](#2-automatic-installation)
@@ -58,18 +59,15 @@
5859
# Installation
5960

6061
<p align="center">
61-
<a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_win.exe">
62+
<a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_win.exe" style="margin: 0 20px;">
6263
<img src="https://img.shields.io/badge/-Windows-blue.svg?style=for-the-badge&logo=windows" alt="Windows">
6364
</a>
64-
<a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_mac">
65+
<a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_mac" style="margin: 0 20px;">
6566
<img src="https://img.shields.io/badge/-macOS-black.svg?style=for-the-badge&logo=apple" alt="macOS">
6667
</a>
67-
<a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_linux">
68+
<a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_linux" style="margin: 0 20px;">
6869
<img src="https://img.shields.io/badge/-Linux-orange.svg?style=for-the-badge&logo=linux" alt="Linux">
6970
</a>
70-
<a href="https://github.com/Arrowar/StreamingCommunity/releases">
71-
<img src="https://img.shields.io/badge/-All_Versions-lightgrey.svg?style=for-the-badge" alt="All Versions">
72-
</a>
7371
</p>
7472

7573

@@ -450,6 +448,33 @@ You can download VLC Media Player from the [official website](https://www.videol
450448
- `get_only_link`: Return M3U8 playlist/index URL instead of downloading
451449

452450

451+
## 🔄 Update Domains
452+
453+
To update the domains for the supported websites:
454+
455+
1. Visit the configuration endpoint: https://www.npoint.io/docs/e67633acc3816cc70132
456+
457+
2. You'll find a JSON structure similar to:
458+
```json
459+
{
460+
"altadefinizione": {
461+
"domain": "si",
462+
"full_url": "https://altadefinizione.si/"
463+
},
464+
...
465+
}
466+
```
467+
468+
3. Update the following fields for each website as needed:
469+
- `domain`: The new domain extension
470+
- `full_url`: The complete URL including the new domain
471+
472+
4. Save your changes on the npoint.io interface
473+
474+
5. Re-run the script to use the updated domain information
475+
476+
Note: The script will automatically fetch the latest domain information from the configuration endpoint when executed.
477+
453478
# COMMAND
454479

455480
- Download a specific season by entering its number.
@@ -559,20 +584,6 @@ Start the bot from the folder /StreamingCommunity/TelegramHelp
559584
python3 telegram_bot.py
560585
```
561586

562-
# Website Status
563-
564-
| Website | Status | Command |
565-
|:-------------------|:------:|:--------:|
566-
| [1337xx](https://1337xx.to/) || -133 |
567-
| [AnimeUnity](https://animeunity.so/) || -ANI |
568-
| [Ilcorsaronero](https://ilcorsaronero.link/) || `-ILC` |
569-
| [CB01New](https://cb01new.gold/) || -CB0 |
570-
| [DDLStreamItaly](https://ddlstreamitaly.co/) || -DDL |
571-
| [GuardaSerie](https://guardaserie.now/) || -GUA |
572-
| [MostraGuarda](https://mostraguarda.stream/) || -MOS |
573-
| [StreamingCommunity](https://streamingcommunity.lu/) || -STR |
574-
575-
576587
# Tutorials
577588

578589
- [Windows Tutorial](https://www.youtube.com/watch?v=mZGqK4wdN-k)

StreamingCommunity/Api/Player/vixcloud.py

+11-13
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@
2323

2424

2525
class VideoSource:
26-
def __init__(self, site_name: str, is_series: bool):
26+
def __init__(self, url: str, is_series: bool):
2727
"""
2828
Initialize video source for streaming site.
2929
3030
Args:
31-
site_name (str): Name of streaming site
32-
is_series (bool): Flag for series or movie content
31+
- url (str): The URL of the streaming site.
32+
- is_series (bool): Flag for series or movie content
3333
"""
3434
self.headers = {'user-agent': get_headers()}
35-
self.base_name = site_name
36-
self.domain = config_manager.get_dict('SITE', self.base_name)['domain']
35+
self.url = url
3736
self.is_series = is_series
3837

3938
def setup(self, media_id: int):
@@ -64,7 +63,7 @@ def get_iframe(self, episode_id: int) -> None:
6463

6564
# Make a request to get iframe source
6665
response = httpx.get(
67-
url=f"https://{self.base_name}.{self.domain}/iframe/{self.media_id}",
66+
url=f"{self.url}/iframe/{self.media_id}",
6867
params=params,
6968
timeout=max_timeout
7069
)
@@ -185,7 +184,7 @@ def get_mp4(self, url_to_download: str, scws_id: str) -> list:
185184
}
186185

187186
# API request to get video details
188-
video_api_url = f'https://{self.base_name}.{self.domain}/api/video/{scws_id}'
187+
video_api_url = f'{self.url}/api/video/{scws_id}'
189188
response = httpx.get(video_api_url, headers=headers)
190189

191190
if response.status_code == 200:
@@ -197,7 +196,7 @@ def get_mp4(self, url_to_download: str, scws_id: str) -> list:
197196

198197
# Request download link generation for each track
199198
download_response = httpx.post(
200-
url=f'https://{self.base_name}.{self.domain}/api/download/generate_link?scws_id={track["video_id"]}&rendition={track["quality"]}',
199+
url=f'{self.url}/api/download/generate_link?scws_id={track["video_id"]}&rendition={track["quality"]}',
201200
headers={
202201
'referer': url_to_download,
203202
'user-agent': get_headers(),
@@ -220,18 +219,17 @@ def get_mp4(self, url_to_download: str, scws_id: str) -> list:
220219

221220

222221
class VideoSourceAnime(VideoSource):
223-
def __init__(self, site_name: str):
222+
def __init__(self, url: str):
224223
"""
225224
Initialize anime-specific video source.
226225
227226
Args:
228-
site_name (str): Name of anime streaming site
227+
- url (str): The URL of the streaming site.
229228
230229
Extends base VideoSource with anime-specific initialization
231230
"""
232231
self.headers = {'user-agent': get_headers()}
233-
self.base_name = site_name
234-
self.domain = config_manager.get_dict('SITE', self.base_name)['domain']
232+
self.url = url
235233
self.src_mp4 = None
236234

237235
def get_embed(self, episode_id: int):
@@ -247,7 +245,7 @@ def get_embed(self, episode_id: int):
247245
try:
248246

249247
response = httpx.get(
250-
url=f"https://www.{self.base_name}.{self.domain}/embed-url/{episode_id}",
248+
url=f"{self.url}/embed-url/{episode_id}",
251249
headers=self.headers,
252250
timeout=max_timeout
253251
)

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

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# 02.07.24
22

3+
import sys
4+
35
# External libraries
46
import httpx
57
from bs4 import BeautifulSoup
@@ -42,12 +44,17 @@ def title_search(word_to_search: str) -> int:
4244
domain_to_use = site_constant.DOMAIN_NOW
4345

4446
if not disable_searchDomain:
45-
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, f"https://{site_constant.SITE_NAME}.{site_constant.DOMAIN_NOW}")
47+
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
48+
49+
if domain_to_use is None or base_url is None:
50+
console.print("[bold red]❌ Error: Unable to determine valid domain or base URL.[/bold red]")
51+
console.print("[yellow]The service might be temporarily unavailable or the domain may have changed.[/yellow]")
52+
sys.exit(1)
4653

4754
# Construct the full site URL and load the search page
4855
try:
4956
response = httpx.get(
50-
url=f"https://{site_constant.SITE_NAME}.{domain_to_use}/search/{word_to_search}/1/",
57+
url=f"{site_constant.FULL_URL}/search/{word_to_search}/1/",
5158
headers={'user-agent': get_headers()},
5259
follow_redirects=True,
5360
timeout=max_timeout

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ def download_title(select_title: MediaItem):
4141
os_manager.create_path(mp4_path)
4242

4343
# Make request to page with magnet
44-
full_site_name = f"{site_constant.SITE_NAME}.{site_constant.DOMAIN_NOW}"
4544
response = httpx.get(
46-
url="https://" + full_site_name + select_title.url,
45+
url=f"{site_constant.FULL_URL}{select_title.url}",
4746
headers={
4847
'user-agent': get_headers()
4948
},

StreamingCommunity/Api/Site/animeunity/film_serie.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def download_episode(index_select: int, scrape_serie: ScrapeSerieAnime, video_so
8585

8686
else:
8787
logging.error(f"Skip index: {index_select} cant find info with api.")
88+
return None, True
8889

8990

9091
def download_series(select_title: MediaItem):
@@ -100,8 +101,8 @@ def download_series(select_title: MediaItem):
100101
if site_constant.TELEGRAM_BOT:
101102
bot = get_bot_instance()
102103

103-
scrape_serie = ScrapeSerieAnime(site_constant.SITE_NAME)
104-
video_source = VideoSourceAnime(site_constant.SITE_NAME)
104+
scrape_serie = ScrapeSerieAnime(site_constant.FULL_URL)
105+
video_source = VideoSourceAnime(site_constant.FULL_URL)
105106

106107
# Set up video source
107108
scrape_serie.setup(None, select_title.id, select_title.slug)
@@ -160,8 +161,8 @@ def download_film(select_title: MediaItem):
160161
"""
161162

162163
# Init class
163-
scrape_serie = ScrapeSerieAnime(site_constant.SITE_NAME)
164-
video_source = VideoSourceAnime(site_constant.SITE_NAME)
164+
scrape_serie = ScrapeSerieAnime(site_constant.FULL_URL)
165+
video_source = VideoSourceAnime(site_constant.FULL_URL)
165166

166167
# Set up video source
167168
scrape_serie.setup(None, select_title.id, select_title.slug)

StreamingCommunity/Api/Site/animeunity/site.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 10.12.23
22

3+
import sys
34
import logging
45

56

@@ -42,7 +43,7 @@ def get_token(site_name: str, domain: str) -> dict:
4243

4344
# Send a GET request to the specified URL composed of the site name and domain
4445
response = httpx.get(
45-
url=f"https://www.{site_name}.{domain}",
46+
url=site_constant.FULL_URL,
4647
timeout=max_timeout
4748
)
4849
response.raise_for_status()
@@ -113,7 +114,12 @@ def title_search(title: str) -> int:
113114
domain_to_use = site_constant.DOMAIN_NOW
114115

115116
if not disable_searchDomain:
116-
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, f"https://www.{site_constant.SITE_NAME}.{site_constant.DOMAIN_NOW}")
117+
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
118+
119+
if domain_to_use is None or base_url is None:
120+
console.print("[bold red]❌ Error: Unable to determine valid domain or base URL.[/bold red]")
121+
console.print("[yellow]The service might be temporarily unavailable or the domain may have changed.[/yellow]")
122+
sys.exit(1)
117123

118124
data = get_token(site_constant.SITE_NAME, domain_to_use)
119125

@@ -138,7 +144,7 @@ def title_search(title: str) -> int:
138144
# Send a POST request to the API endpoint for live search
139145
try:
140146
response = httpx.post(
141-
url=f'https://www.{site_constant.SITE_NAME}.{domain_to_use}/livesearch',
147+
url=f'{site_constant.FULL_URL}/livesearch',
142148
cookies=cookies,
143149
headers=headers,
144150
json=json_data,

StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,17 @@
1818

1919

2020

21-
class ScrapeSerieAnime():
22-
def __init__(self, site_name: str):
21+
class ScrapeSerieAnime:
22+
def __init__(self, url: str):
2323
"""
2424
Initialize the media scraper for a specific website.
2525
2626
Args:
27-
site_name (str): Name of the streaming site to scrape
27+
url (str): Url of the streaming site
2828
"""
2929
self.is_series = False
3030
self.headers = {'user-agent': get_headers()}
31-
self.base_name = site_name
32-
self.domain = config_manager.get_dict('SITE', self.base_name)['domain']
31+
self.url = url
3332

3433
def setup(self, version: str = None, media_id: int = None, series_name: str = None):
3534
self.version = version
@@ -50,7 +49,7 @@ def get_count_episodes(self):
5049
try:
5150

5251
response = httpx.get(
53-
url=f"https://www.{self.base_name}.{self.domain}/info_api/{self.media_id}/",
52+
url=f"{self.url}/info_api/{self.media_id}/",
5453
headers=self.headers,
5554
timeout=max_timeout
5655
)
@@ -81,7 +80,7 @@ def get_info_episode(self, index_ep: int) -> Episode:
8180
}
8281

8382
response = httpx.get(
84-
url=f"https://www.{self.base_name}.{self.domain}/info_api/{self.media_id}/{index_ep}",
83+
url=f"{self.url}/info_api/{self.media_id}/{index_ep}",
8584
headers=self.headers,
8685
params=params,
8786
timeout=max_timeout

StreamingCommunity/Api/Site/cb01new/site.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# 03.07.24
22

3+
import sys
4+
35
# External libraries
46
import httpx
57
from bs4 import BeautifulSoup
68

79

810
# Internal utilities
11+
from StreamingCommunity.Util.console import console
912
from StreamingCommunity.Util._jsonConfig import config_manager
1013
from StreamingCommunity.Util.headers import get_headers
1114
from StreamingCommunity.Util.table import TVShowManager
@@ -41,10 +44,15 @@ def title_search(word_to_search: str) -> int:
4144
domain_to_use = site_constant.DOMAIN_NOW
4245

4346
if not disable_searchDomain:
44-
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, f"https://{site_constant.SITE_NAME}.{site_constant.DOMAIN_NOW}")
47+
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
48+
49+
if domain_to_use is None or base_url is None:
50+
console.print("[bold red]❌ Error: Unable to determine valid domain or base URL.[/bold red]")
51+
console.print("[yellow]The service might be temporarily unavailable or the domain may have changed.[/yellow]")
52+
sys.exit(1)
4553

4654
response = httpx.get(
47-
url=f"https://{site_constant.SITE_NAME}.{domain_to_use}/?s={word_to_search}",
55+
url=f"{site_constant.FULL_URL}/?s={word_to_search}",
4856
headers={'user-agent': get_headers()},
4957
timeout=max_timeout
5058
)

0 commit comments

Comments
 (0)