Fix domain site api.

This commit is contained in:
Lovi 2024-06-16 18:08:11 +02:00
parent 19f5439c0f
commit 1ba1db3e14
10 changed files with 26 additions and 48 deletions

View File

@ -4,9 +4,6 @@
from Src.Util.console import console, msg from Src.Util.console import console, msg
# Variable
indice = 5
def search(): def search():
""" """

View File

@ -3,14 +3,10 @@
from typing import Dict, Any, List from typing import Dict, Any, List
# Internal utilities # Variable
from Src.Util._jsonConfig import config_manager from ...costant import SITE_NAME, DOMAIN_NOW
# Config
AU_SITE_NAME = "animeunity"
AU_DOMAIN_NOW = config_manager.get('SITE', AU_SITE_NAME)
class Image: class Image:
@ -23,7 +19,7 @@ class Image:
self.created_at: str = image_data.get('created_at', '') self.created_at: str = image_data.get('created_at', '')
self.updated_at: str = image_data.get('updated_at', '') self.updated_at: str = image_data.get('updated_at', '')
self.original_url_field: str = image_data.get('original_url_field', '') self.original_url_field: str = image_data.get('original_url_field', '')
self.url: str = f"https://cdn.{AU_SITE_NAME}.{AU_DOMAIN_NOW}/images/{self.filename}" self.url: str = f"https://cdn.{SITE_NAME}.{DOMAIN_NOW}/images/{self.filename}"
def __str__(self): def __str__(self):
return f"Image(id={self.id}, filename='{self.filename}', type='{self.type}', imageable_type='{self.imageable_type}', url='{self.url}')" return f"Image(id={self.id}, filename='{self.filename}', type='{self.type}', imageable_type='{self.imageable_type}', url='{self.url}')"

View File

@ -3,13 +3,8 @@
from typing import List from typing import List
# Internal utilities # Variable
from Src.Util._jsonConfig import config_manager from ...costant import SITE_NAME, DOMAIN_NOW
# Config
AU_SITE_NAME = "animeunity"
AU_DOMAIN_NOW = config_manager.get('SITE', AU_SITE_NAME)
@ -20,7 +15,7 @@ class Image:
self.filename: str = data.get('filename') self.filename: str = data.get('filename')
self.type: str = data.get('type') self.type: str = data.get('type')
self.original_url_field: str = data.get('original_url_field') self.original_url_field: str = data.get('original_url_field')
self.url: str = f"https://cdn.{AU_SITE_NAME}.{AU_DOMAIN_NOW}/images/{self.filename}" self.url: str = f"https://cdn.{SITE_NAME}.{DOMAIN_NOW}/images/{self.filename}"
def __str__(self): def __str__(self):
return f"Image(imageable_id={self.imageable_id}, imageable_type='{self.imageable_type}', filename='{self.filename}', type='{self.type}', url='{self.url}')" return f"Image(imageable_id={self.imageable_id}, imageable_type='{self.imageable_type}', filename='{self.filename}', type='{self.type}', url='{self.url}')"

View File

@ -12,17 +12,19 @@ from bs4 import BeautifulSoup
# Internal utilities # Internal utilities
from Src.Util.headers import get_headers from Src.Util.headers import get_headers
from Src.Util.console import console
from Src.Util._jsonConfig import config_manager from Src.Util._jsonConfig import config_manager
# Logic class # Logic class
from ..Class.SeriesType import TitleManager from ..Class.SeriesType import TitleManager
from ..Class.EpisodeType import EpisodeManager, Episode from ..Class.EpisodeType import EpisodeManager, Episode
from ..Class.PreviewType import PreviewManager
from ..Class.WindowType import WindowVideo, WindowParameter, DynamicJSONConverter from ..Class.WindowType import WindowVideo, WindowParameter, DynamicJSONConverter
# Variable
from ...costant import SITE_NAME
class VideoSource: class VideoSource:
def __init__(self): def __init__(self):
""" """
@ -32,7 +34,7 @@ class VideoSource:
'user-agent': get_headers() 'user-agent': get_headers()
} }
self.is_series = False self.is_series = False
self.base_name = "animeunity" self.base_name = SITE_NAME
self.domain = config_manager.get('SITE', self.base_name) self.domain = config_manager.get('SITE', self.base_name)
def setup(self, media_id: int = None, series_name: str = None): def setup(self, media_id: int = None, series_name: str = None):

View File

@ -21,12 +21,8 @@ from .Core.Util import extract_domain
from .Core.Class.SearchType import MediaManager, MediaItem from .Core.Class.SearchType import MediaManager, MediaItem
# Config
SITE_NAME = "animeunity"
DOMAIN_NOW = config_manager.get('SITE', SITE_NAME)
# Variable # Variable
from .costant import SITE_NAME, DOMAIN_NOW
media_search_manager = MediaManager() media_search_manager = MediaManager()
table_show_manager = TVShowManager() table_show_manager = TVShowManager()

View File

@ -3,13 +3,8 @@
from typing import Dict, Any, List from typing import Dict, Any, List
# Internal utilities # Variable
from Src.Util._jsonConfig import config_manager from ...costant import SITE_NAME, DOMAIN_NOW
# Config
SC_SITE_NAME = "streamingcommunity"
SC_DOMAIN_NOW = config_manager.get('SITE', SC_SITE_NAME)
@ -23,7 +18,7 @@ class Image:
self.created_at: str = image_data.get('created_at', '') self.created_at: str = image_data.get('created_at', '')
self.updated_at: str = image_data.get('updated_at', '') self.updated_at: str = image_data.get('updated_at', '')
self.original_url_field: str = image_data.get('original_url_field', '') self.original_url_field: str = image_data.get('original_url_field', '')
self.url: str = f"https://cdn.{SC_SITE_NAME}.{SC_DOMAIN_NOW}/images/{self.filename}" self.url: str = f"https://cdn.{SITE_NAME}.{DOMAIN_NOW}/images/{self.filename}"
def __str__(self): def __str__(self):
return f"Image(id={self.id}, filename='{self.filename}', type='{self.type}', imageable_type='{self.imageable_type}', url='{self.url}')" return f"Image(id={self.id}, filename='{self.filename}', type='{self.type}', imageable_type='{self.imageable_type}', url='{self.url}')"

View File

@ -3,13 +3,8 @@
from typing import List from typing import List
# Internal utilities # Variable
from Src.Util._jsonConfig import config_manager from ...costant import SITE_NAME, DOMAIN_NOW
# Config
SC_SITE_NAME = "streamingcommunity"
SC_DOMAIN_NOW = config_manager.get('SITE', SC_SITE_NAME)
@ -20,7 +15,7 @@ class Image:
self.filename: str = data.get('filename') self.filename: str = data.get('filename')
self.type: str = data.get('type') self.type: str = data.get('type')
self.original_url_field: str = data.get('original_url_field') self.original_url_field: str = data.get('original_url_field')
self.url: str = f"https://cdn.{SC_SITE_NAME}.{SC_DOMAIN_NOW}/images/{self.filename}" self.url: str = f"https://cdn.{SITE_NAME}.{DOMAIN_NOW}/images/{self.filename}"
def __str__(self): def __str__(self):
return f"Image(imageable_id={self.imageable_id}, imageable_type='{self.imageable_type}', filename='{self.filename}', type='{self.type}', url='{self.url}')" return f"Image(imageable_id={self.imageable_id}, imageable_type='{self.imageable_type}', filename='{self.filename}', type='{self.type}', url='{self.url}')"

View File

@ -18,10 +18,13 @@ from Src.Util.console import console, Panel
# Logic class # Logic class
from ..Class.SeriesType import TitleManager from ..Class.SeriesType import TitleManager
from ..Class.EpisodeType import EpisodeManager from ..Class.EpisodeType import EpisodeManager
from ..Class.PreviewType import PreviewManager
from ..Class.WindowType import WindowVideo, WindowParameter, DynamicJSONConverter from ..Class.WindowType import WindowVideo, WindowParameter, DynamicJSONConverter
# Variable
from ...costant import SITE_NAME
class VideoSource: class VideoSource:
def __init__(self): def __init__(self):
""" """
@ -31,7 +34,7 @@ class VideoSource:
'user-agent': get_headers() 'user-agent': get_headers()
} }
self.is_series = False self.is_series = False
self.base_name = "streamingcommunity" self.base_name = SITE_NAME
def setup(self, version: str = None, domain: str = None, media_id: int = None, series_name: str = None): def setup(self, version: str = None, domain: str = None, media_id: int = None, series_name: str = None):
""" """

View File

@ -26,8 +26,7 @@ from .Core.Class.SearchType import MediaManager, MediaItem
# Config # Config
SITE_NAME = "streamingcommunity" from .costant import SITE_NAME
DOMAIN_NOW = config_manager.get('SITE', SITE_NAME)
# Variable # Variable

View File

@ -52,8 +52,8 @@
"force_resolution": -1 "force_resolution": -1
}, },
"SITE": { "SITE": {
"Streamingcommunity": "foo", "streamingcommunity": "foo",
"Animeunity": "to", "animeunity": "to",
"Altadefinizione": "vodka", "Altadefinizione": "vodka",
"Guardaserie": "ceo", "Guardaserie": "ceo",
"Ddlstreamitaly": "co", "Ddlstreamitaly": "co",