mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-08 04:25:24 +00:00

* Migrate to httpx * Revert "Migrate to httpx" This reverts commit fdd2823865824eca5e8cb8806dbddba4bcb37280. * Migrate httpx * minor fixes (#146) * Update headers * Update config * 1v. Add retry * v1 Finish Guardaserie * Need to fix client. * Remove retry * v2 Add comment guardaserie. * Add domain ... * Finish add ddl ... * Fix use of proxy. * Fix cookie error. * Update cookie. * Dynamic import. --------- Co-authored-by: Francesco Grazioso <40018163+FrancescoGrazioso@users.noreply.github.com>
44 lines
967 B
Python
44 lines
967 B
Python
# 09.06.24
|
|
|
|
import sys
|
|
import logging
|
|
|
|
|
|
# Internal utilities
|
|
from Src.Util.console import console, msg
|
|
|
|
|
|
# Logic class
|
|
from .site import title_search, get_select_title
|
|
from .series import download_thread
|
|
|
|
|
|
# Variable
|
|
indice = 3
|
|
|
|
|
|
def search():
|
|
"""
|
|
Main function of the application for film and series.
|
|
"""
|
|
|
|
# Make request to site to get content that corrsisponde to that string
|
|
string_to_search = msg.ask("\n[purple]Insert word to search in all site").strip()
|
|
len_database = title_search(string_to_search)
|
|
|
|
if len_database > 0:
|
|
|
|
# Select title from list
|
|
select_title = get_select_title()
|
|
|
|
# Download only film
|
|
if "Serie TV" in str(select_title.type):
|
|
download_thread(select_title)
|
|
|
|
else:
|
|
logging.error(f"Not supported: {select_title.type}")
|
|
sys.exit(0)
|
|
|
|
else:
|
|
console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
|