mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-06 11:35:29 +00:00
api: From cb01blog to cb01new
This commit is contained in:
parent
542b090434
commit
477637ee5c
3
.gitignore
vendored
3
.gitignore
vendored
@ -51,4 +51,5 @@ note.txt
|
|||||||
cmd.txt
|
cmd.txt
|
||||||
bot_config.json
|
bot_config.json
|
||||||
scripts.json
|
scripts.json
|
||||||
active_requests.json
|
active_requests.json
|
||||||
|
domains.json
|
@ -634,6 +634,9 @@ The API-based domain updates are currently deprecated. To use it anyway, set `us
|
|||||||
|
|
||||||
Note: If `use_api` is set to `false` and no `domains.json` file is found, the script will raise an error.
|
Note: If `use_api` is set to `false` and no `domains.json` file is found, the script will raise an error.
|
||||||
|
|
||||||
|
#### 💡 Adding a New Site to the Legacy API
|
||||||
|
If you want to add a new site to the legacy API, just message me on the Discord server, and I'll add it!
|
||||||
|
|
||||||
# COMMAND
|
# COMMAND
|
||||||
|
|
||||||
- Download a specific season by entering its number.
|
- Download a specific season by entering its number.
|
||||||
|
@ -40,7 +40,7 @@ def title_search(word_to_search: str) -> int:
|
|||||||
media_search_manager.clear()
|
media_search_manager.clear()
|
||||||
table_show_manager.clear()
|
table_show_manager.clear()
|
||||||
|
|
||||||
search_url = f"{site_constant.FULL_URL}/?story={word_to_search}&do=search&subaction=search"
|
search_url = f"{site_constant.FULL_URL}/?s={word_to_search}"
|
||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -54,10 +54,11 @@ def title_search(word_to_search: str) -> int:
|
|||||||
# Create soup and find table
|
# Create soup and find table
|
||||||
soup = BeautifulSoup(response.text, "html.parser")
|
soup = BeautifulSoup(response.text, "html.parser")
|
||||||
|
|
||||||
for div in soup.find_all("div", class_ = "short-main"):
|
for card in soup.find_all("div", class_=["card", "mp-post", "horizontal"]):
|
||||||
try:
|
try:
|
||||||
url = div.find("a").get("href")
|
title_tag = card.find("h3", class_="card-title").find("a")
|
||||||
title = div.find("a").get_text(strip=True)
|
url = title_tag.get("href")
|
||||||
|
title = title_tag.get_text(strip=True)
|
||||||
|
|
||||||
title_info = {
|
title_info = {
|
||||||
'name': title,
|
'name': title,
|
||||||
|
@ -196,6 +196,7 @@ class ConfigManager:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error reading configuration file: {e}")
|
logging.error(f"Error reading configuration file: {e}")
|
||||||
console.print(f"[bold red]Failed to read configuration:[/bold red] {str(e)}")
|
console.print(f"[bold red]Failed to read configuration:[/bold red] {str(e)}")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
def download_requirements(self, url: str, filename: str) -> None:
|
def download_requirements(self, url: str, filename: str) -> None:
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user