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
# Variable
indice = 5
def search():
"""

View File

@ -3,14 +3,10 @@
from typing import Dict, Any, List
# Internal utilities
from Src.Util._jsonConfig import config_manager
# Variable
from ...costant import SITE_NAME, DOMAIN_NOW
# Config
AU_SITE_NAME = "animeunity"
AU_DOMAIN_NOW = config_manager.get('SITE', AU_SITE_NAME)
class Image:
@ -23,7 +19,7 @@ class Image:
self.created_at: str = image_data.get('created_at', '')
self.updated_at: str = image_data.get('updated_at', '')
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):
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
# Internal utilities
from Src.Util._jsonConfig import config_manager
# Config
AU_SITE_NAME = "animeunity"
AU_DOMAIN_NOW = config_manager.get('SITE', AU_SITE_NAME)
# Variable
from ...costant import SITE_NAME, DOMAIN_NOW
@ -20,7 +15,7 @@ class Image:
self.filename: str = data.get('filename')
self.type: str = data.get('type')
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):
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
from Src.Util.headers import get_headers
from Src.Util.console import console
from Src.Util._jsonConfig import config_manager
# Logic class
from ..Class.SeriesType import TitleManager
from ..Class.EpisodeType import EpisodeManager, Episode
from ..Class.PreviewType import PreviewManager
from ..Class.WindowType import WindowVideo, WindowParameter, DynamicJSONConverter
# Variable
from ...costant import SITE_NAME
class VideoSource:
def __init__(self):
"""
@ -32,7 +34,7 @@ class VideoSource:
'user-agent': get_headers()
}
self.is_series = False
self.base_name = "animeunity"
self.base_name = SITE_NAME
self.domain = config_manager.get('SITE', self.base_name)
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
# Config
SITE_NAME = "animeunity"
DOMAIN_NOW = config_manager.get('SITE', SITE_NAME)
# Variable
from .costant import SITE_NAME, DOMAIN_NOW
media_search_manager = MediaManager()
table_show_manager = TVShowManager()

View File

@ -3,13 +3,8 @@
from typing import Dict, Any, List
# Internal utilities
from Src.Util._jsonConfig import config_manager
# Config
SC_SITE_NAME = "streamingcommunity"
SC_DOMAIN_NOW = config_manager.get('SITE', SC_SITE_NAME)
# Variable
from ...costant import SITE_NAME, DOMAIN_NOW
@ -23,7 +18,7 @@ class Image:
self.created_at: str = image_data.get('created_at', '')
self.updated_at: str = image_data.get('updated_at', '')
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):
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
# Internal utilities
from Src.Util._jsonConfig import config_manager
# Config
SC_SITE_NAME = "streamingcommunity"
SC_DOMAIN_NOW = config_manager.get('SITE', SC_SITE_NAME)
# Variable
from ...costant import SITE_NAME, DOMAIN_NOW
@ -20,7 +15,7 @@ class Image:
self.filename: str = data.get('filename')
self.type: str = data.get('type')
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):
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
from ..Class.SeriesType import TitleManager
from ..Class.EpisodeType import EpisodeManager
from ..Class.PreviewType import PreviewManager
from ..Class.WindowType import WindowVideo, WindowParameter, DynamicJSONConverter
# Variable
from ...costant import SITE_NAME
class VideoSource:
def __init__(self):
"""
@ -31,7 +34,7 @@ class VideoSource:
'user-agent': get_headers()
}
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):
"""

View File

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

View File

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