mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-05 02:55:25 +00:00
Setup for pypi
This commit is contained in:
parent
ffe783ac6a
commit
e76a0ebd2c
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
<<<<<<< HEAD
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
6
MANIFEST.in
Normal file
6
MANIFEST.in
Normal file
@ -0,0 +1,6 @@
|
||||
include README.md
|
||||
include LICENSE
|
||||
include requirements.txt
|
||||
include config.py
|
||||
recursive-include Test/ *
|
||||
recursive-include StreamingCommunity/ *.py
|
@ -1,5 +1,5 @@
|
||||
<p align="center">
|
||||
<img src="./Src/Assets/min_logo.png">
|
||||
<img src="https://i.ibb.co/f4h5Y2m/min-logo.png">
|
||||
</p>
|
||||
|
||||
This repository provide a simple script designed to downloading films and series from a variety of supported streaming platforms. [SITE](#website-status-)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
@ -9,12 +9,12 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
|
||||
|
||||
# Variable
|
||||
from Src.Api.Site.ddlstreamitaly.costant import COOKIE
|
||||
from StreamingCommunity.Src.Api.Site.ddlstreamitaly.costant import COOKIE
|
||||
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
||||
|
||||
|
@ -11,8 +11,8 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
|
||||
|
||||
# Variable
|
@ -11,8 +11,8 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
|
||||
|
||||
# Variable
|
@ -11,9 +11,9 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.console import console, Panel
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.console import console, Panel
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from .Helper.Vixcloud.util import Episode, EpisodeManager, Season, SeasonManager, WindowVideo, WindowParameter, DynamicJSONConverter
|
||||
|
||||
|
@ -4,7 +4,7 @@ from unidecode import unidecode
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
|
||||
|
||||
# Logic class
|
@ -4,7 +4,7 @@ import os
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
@ -6,16 +6,16 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template import get_select_title
|
||||
from Src.Api.Template.Util import search_domain
|
||||
from Src.Api.Template.Class.SearchType import MediaManager
|
||||
from StreamingCommunity.Src.Api.Template import get_select_title
|
||||
from StreamingCommunity.Src.Api.Template.Util import search_domain
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaManager
|
||||
|
||||
|
||||
# Variable
|
@ -9,15 +9,15 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util.os import os_manager
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Lib.Downloader import TOR_downloader
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Lib.Downloader import TOR_downloader
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaItem
|
||||
|
||||
|
||||
# Config
|
@ -4,7 +4,7 @@ from unidecode import unidecode
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
|
||||
|
||||
# Logic class
|
@ -4,7 +4,7 @@ import os
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
@ -5,20 +5,20 @@ import time
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from Src.Util.os import os_manager
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.call_stack import get_call_stack
|
||||
from Src.Lib.Downloader import HLS_Downloader
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.call_stack import get_call_stack
|
||||
from StreamingCommunity.Src.Lib.Downloader import HLS_Downloader
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Util import execute_search
|
||||
from Src.Api.Template.Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template.Util import execute_search
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaItem
|
||||
|
||||
|
||||
# Player
|
||||
from Src.Api.Player.supervideo import VideoSource
|
||||
from StreamingCommunity.Src.Api.Player.supervideo import VideoSource
|
||||
|
||||
|
||||
# Config
|
@ -6,16 +6,16 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template import get_select_title
|
||||
from Src.Api.Template.Util import search_domain
|
||||
from Src.Api.Template.Class.SearchType import MediaManager
|
||||
from StreamingCommunity.Src.Api.Template import get_select_title
|
||||
from StreamingCommunity.Src.Api.Template.Util import search_domain
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaManager
|
||||
|
||||
|
||||
# Variable
|
@ -4,7 +4,7 @@ from unidecode import unidecode
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
|
||||
|
||||
# Logic class
|
@ -6,19 +6,19 @@ import logging
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from Src.Util.os import os_manager
|
||||
from Src.Util.message import start_message
|
||||
from Src.Lib.Downloader import MP4_downloader
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Lib.Downloader import MP4_downloader
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Util import manage_selection
|
||||
from Src.Api.Template.Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template.Util import manage_selection
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaItem
|
||||
|
||||
|
||||
# Player
|
||||
from Src.Api.Player.vixcloud import AnimeVideoSource as VideoSource
|
||||
from StreamingCommunity.Src.Api.Player.vixcloud import AnimeVideoSource as VideoSource
|
||||
|
||||
|
||||
# Variable
|
@ -4,7 +4,7 @@ import os
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
@ -9,15 +9,15 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template import get_select_title
|
||||
from Src.Api.Template.Util import search_domain
|
||||
from Src.Api.Template.Class.SearchType import MediaManager
|
||||
from StreamingCommunity.Src.Api.Template import get_select_title
|
||||
from StreamingCommunity.Src.Api.Template.Util import search_domain
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaManager
|
||||
|
||||
|
||||
# Variable
|
@ -4,7 +4,7 @@ from unidecode import unidecode
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
|
||||
|
||||
# Logic class
|
@ -4,7 +4,7 @@ import os
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
@ -6,16 +6,16 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template import get_select_title
|
||||
from Src.Api.Template.Util import search_domain
|
||||
from Src.Api.Template.Class.SearchType import MediaManager
|
||||
from StreamingCommunity.Src.Api.Template import get_select_title
|
||||
from StreamingCommunity.Src.Api.Template.Util import search_domain
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaManager
|
||||
|
||||
|
||||
# Variable
|
@ -4,14 +4,14 @@ import os
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.os import os_manager
|
||||
from Src.Lib.Downloader import TOR_downloader
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Lib.Downloader import TOR_downloader
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaItem
|
||||
|
||||
|
||||
# Config
|
@ -4,7 +4,7 @@ from unidecode import unidecode
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
|
||||
|
||||
# Logic class
|
@ -4,7 +4,7 @@ import os
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
@ -5,20 +5,20 @@ import time
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from Src.Util.os import os_manager
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.call_stack import get_call_stack
|
||||
from Src.Lib.Downloader import HLS_Downloader
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.call_stack import get_call_stack
|
||||
from StreamingCommunity.Src.Lib.Downloader import HLS_Downloader
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Util import execute_search
|
||||
from Src.Api.Template.Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template.Util import execute_search
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaItem
|
||||
|
||||
|
||||
# Player
|
||||
from Src.Api.Player.maxstream import VideoSource
|
||||
from StreamingCommunity.Src.Api.Player.maxstream import VideoSource
|
||||
|
||||
|
||||
# Config
|
@ -6,15 +6,15 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template import get_select_title
|
||||
from Src.Api.Template.Util import search_domain
|
||||
from Src.Api.Template.Class.SearchType import MediaManager
|
||||
from StreamingCommunity.Src.Api.Template import get_select_title
|
||||
from StreamingCommunity.Src.Api.Template.Util import search_domain
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaManager
|
||||
|
||||
|
||||
# Variable
|
@ -11,11 +11,11 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaItem
|
||||
|
||||
|
||||
# Variable
|
@ -5,7 +5,7 @@ from unidecode import unidecode
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
|
||||
|
||||
# Logic class
|
@ -4,7 +4,7 @@ import os
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
@ -6,21 +6,21 @@ from urllib.parse import urlparse
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.os import os_manager
|
||||
from Src.Util.table import TVShowManager
|
||||
from Src.Lib.Downloader import MP4_downloader
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Lib.Downloader import MP4_downloader
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Class.SearchType import MediaItem
|
||||
from Src.Api.Template.Util import manage_selection, map_episode_title, validate_episode_selection
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template.Util import manage_selection, map_episode_title, validate_episode_selection
|
||||
|
||||
|
||||
# Player
|
||||
from .Player.ScrapeSerie import GetSerieInfo
|
||||
from Src.Api.Player.ddl import VideoSource
|
||||
from StreamingCommunity.Src.Api.Player.ddl import VideoSource
|
||||
|
||||
|
||||
# Variable
|
@ -9,16 +9,16 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template import get_select_title
|
||||
from Src.Api.Template.Util import search_domain
|
||||
from Src.Api.Template.Class.SearchType import MediaManager
|
||||
from StreamingCommunity.Src.Api.Template import get_select_title
|
||||
from StreamingCommunity.Src.Api.Template.Util import search_domain
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaManager
|
||||
|
||||
|
||||
# Variable
|
@ -10,11 +10,11 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template .Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template .Class.SearchType import MediaItem
|
||||
|
||||
|
||||
class GetSerieInfo:
|
@ -4,7 +4,7 @@ from unidecode import unidecode
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
|
||||
|
||||
# Logic class
|
@ -4,7 +4,7 @@ import os
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
@ -6,21 +6,21 @@ import time
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.call_stack import get_call_stack
|
||||
from Src.Util.table import TVShowManager
|
||||
from Src.Lib.Downloader import HLS_Downloader
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.call_stack import get_call_stack
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Lib.Downloader import HLS_Downloader
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Util import manage_selection, map_episode_title, validate_selection, validate_episode_selection, execute_search
|
||||
from Src.Api.Template.Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template.Util import manage_selection, map_episode_title, validate_selection, validate_episode_selection, execute_search
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaItem
|
||||
|
||||
|
||||
# Player
|
||||
from .Player.ScrapeSerie import GetSerieInfo
|
||||
from Src.Api.Player.supervideo import VideoSource
|
||||
from StreamingCommunity.Src.Api.Player.supervideo import VideoSource
|
||||
|
||||
|
||||
# Variable
|
@ -6,16 +6,16 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template import get_select_title
|
||||
from Src.Api.Template.Util import search_domain
|
||||
from Src.Api.Template.Class.SearchType import MediaManager
|
||||
from StreamingCommunity.Src.Api.Template import get_select_title
|
||||
from StreamingCommunity.Src.Api.Template.Util import search_domain
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaManager
|
||||
|
||||
|
||||
# Variable
|
@ -4,11 +4,11 @@ from unidecode import unidecode
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Lib.TMBD import tmdb, Json_film
|
||||
from StreamingCommunity.Src.Lib.TMBD import tmdb, Json_film
|
||||
from .film import download_film
|
||||
|
||||
|
@ -4,7 +4,7 @@ import os
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
@ -12,24 +12,24 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from Src.Util.os import os_manager
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.call_stack import get_call_stack
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Lib.Downloader import HLS_Downloader
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.call_stack import get_call_stack
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Lib.Downloader import HLS_Downloader
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Util import execute_search
|
||||
from StreamingCommunity.Src.Api.Template.Util import execute_search
|
||||
|
||||
|
||||
# Player
|
||||
from Src.Api.Player.supervideo import VideoSource
|
||||
from StreamingCommunity.Src.Api.Player.supervideo import VideoSource
|
||||
|
||||
|
||||
# TMBD
|
||||
from Src.Lib.TMBD import Json_film
|
||||
from StreamingCommunity.Src.Lib.TMBD import Json_film
|
||||
|
||||
|
||||
# Config
|
@ -4,7 +4,7 @@ from unidecode import unidecode
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
|
||||
|
||||
# Logic class
|
@ -4,7 +4,7 @@ import os
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
@ -6,15 +6,15 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template import get_select_title
|
||||
from Src.Api.Template.Class.SearchType import MediaManager
|
||||
from StreamingCommunity.Src.Api.Template import get_select_title
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaManager
|
||||
|
||||
|
||||
# Variable
|
@ -5,14 +5,14 @@ import sys
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.os import os_manager
|
||||
from Src.Lib.Downloader import TOR_downloader
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Lib.Downloader import TOR_downloader
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaItem
|
||||
|
||||
|
||||
# Config
|
@ -4,7 +4,7 @@ from unidecode import unidecode
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
|
||||
|
||||
# Logic class
|
@ -4,7 +4,7 @@ import os
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
@ -5,20 +5,20 @@ import time
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from Src.Util.os import os_manager
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.call_stack import get_call_stack
|
||||
from Src.Lib.Downloader import HLS_Downloader
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.call_stack import get_call_stack
|
||||
from StreamingCommunity.Src.Lib.Downloader import HLS_Downloader
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Util import execute_search
|
||||
from Src.Api.Template.Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template.Util import execute_search
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaItem
|
||||
|
||||
|
||||
# Player
|
||||
from Src.Api.Player.vixcloud import VideoSource
|
||||
from StreamingCommunity.Src.Api.Player.vixcloud import VideoSource
|
||||
|
||||
|
||||
# Variable
|
@ -6,20 +6,20 @@ import time
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console, msg
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.call_stack import get_call_stack
|
||||
from Src.Util.table import TVShowManager
|
||||
from Src.Lib.Downloader import HLS_Downloader
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.call_stack import get_call_stack
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Lib.Downloader import HLS_Downloader
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template.Util import manage_selection, map_episode_title, validate_selection, validate_episode_selection, execute_search
|
||||
from Src.Api.Template.Class.SearchType import MediaItem
|
||||
from StreamingCommunity.Src.Api.Template.Util import manage_selection, map_episode_title, validate_selection, validate_episode_selection, execute_search
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaItem
|
||||
|
||||
|
||||
# Player
|
||||
from Src.Api.Player.vixcloud import VideoSource
|
||||
from StreamingCommunity.Src.Api.Player.vixcloud import VideoSource
|
||||
|
||||
|
||||
# Variable
|
@ -11,17 +11,17 @@ from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
|
||||
|
||||
|
||||
# Logic class
|
||||
from Src.Api.Template import get_select_title
|
||||
from Src.Api.Template.Util import search_domain
|
||||
from Src.Api.Template.Class.SearchType import MediaManager
|
||||
from StreamingCommunity.Src.Api.Template import get_select_title
|
||||
from StreamingCommunity.Src.Api.Template.Util import search_domain
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaManager
|
||||
|
||||
|
||||
# Config
|
@ -10,9 +10,9 @@ from googlesearch import search
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.console import console, msg
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
def google_search(query):
|
@ -5,8 +5,8 @@ from typing import List
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
|
||||
|
||||
# Config
|
@ -21,7 +21,7 @@ def execute_search(info):
|
||||
# Attempt to import the specified function from the module
|
||||
try:
|
||||
# Construct the import statement dynamically
|
||||
module_path = f"Src.Api.Site{info['folder_base']}"
|
||||
module_path = f"StreamingCommunity.Src.Api.Site{info['folder_base']}"
|
||||
exec(f"from {module_path} import {info['function']}")
|
||||
|
||||
# Call the specified function
|
@ -4,7 +4,7 @@ import sys
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
|
||||
|
||||
# Variable
|
@ -10,10 +10,10 @@ import httpx
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.console import console, Panel, Table
|
||||
from Src.Util.color import Colors
|
||||
from Src.Util.os import (
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.console import console, Panel, Table
|
||||
from StreamingCommunity.Src.Util.color import Colors
|
||||
from StreamingCommunity.Src.Util.os import (
|
||||
compute_sha1_hash,
|
||||
os_manager,
|
||||
internet_manager
|
@ -11,9 +11,9 @@ import httpx
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
|
||||
|
||||
class ProxyManager:
|
@ -18,12 +18,12 @@ from tqdm import tqdm
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util.headers import get_headers, random_headers
|
||||
from Src.Util.color import Colors
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.os import os_manager
|
||||
from Src.Util.call_stack import get_call_stack
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util.headers import get_headers, random_headers
|
||||
from StreamingCommunity.Src.Util.color import Colors
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.os import os_manager
|
||||
from StreamingCommunity.Src.Util.call_stack import get_call_stack
|
||||
|
||||
|
||||
# Logic class
|
@ -11,11 +11,11 @@ from tqdm import tqdm
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.headers import get_headers
|
||||
from Src.Util.color import Colors
|
||||
from Src.Util.console import console, Panel
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.os import internet_manager
|
||||
from StreamingCommunity.Src.Util.headers import get_headers
|
||||
from StreamingCommunity.Src.Util.color import Colors
|
||||
from StreamingCommunity.Src.Util.console import console, Panel
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.os import internet_manager
|
||||
|
||||
|
||||
# Logic class
|
@ -8,9 +8,9 @@ import logging
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.color import Colors
|
||||
from Src.Util.os import internet_manager
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.color import Colors
|
||||
from StreamingCommunity.Src.Util.os import internet_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
# External libraries
|
@ -10,7 +10,7 @@ from seleniumbase import Driver
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
# Config
|
@ -7,8 +7,8 @@ import subprocess
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util.os import internet_manager
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util.os import internet_manager
|
||||
|
||||
|
||||
# Variable
|
@ -8,9 +8,9 @@ from typing import List, Dict
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Util.os import os_manager, suppress_output
|
||||
from Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.os import os_manager, suppress_output
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from .util import need_to_force_to_ts, check_duration_v_a
|
||||
from .capture import capture_ffmpeg_real_time
|
||||
from ..M3U8 import M3U8_Codec
|
@ -9,7 +9,7 @@ from typing import Tuple
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
|
||||
|
||||
def has_audio_stream(video_path: str) -> bool:
|
@ -7,7 +7,7 @@ import importlib.util
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
|
||||
|
||||
# Check if Crypto module is installed
|
@ -13,9 +13,9 @@ from tqdm import tqdm
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.color import Colors
|
||||
from Src.Util.os import internet_manager
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.color import Colors
|
||||
from StreamingCommunity.Src.Util.os import internet_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
# Variable
|
@ -6,7 +6,7 @@ import logging
|
||||
|
||||
# Internal utilities
|
||||
from m3u8 import loads
|
||||
from Src.Util.os import internet_manager
|
||||
from StreamingCommunity.Src.Util.os import internet_manager
|
||||
|
||||
|
||||
# External libraries
|
@ -11,7 +11,7 @@ from rich.console import Console
|
||||
|
||||
# Internal utilities
|
||||
from .obj_tmbd import Json_film
|
||||
from Src.Util.table import TVShowManager
|
||||
from StreamingCommunity.Src.Util.table import TVShowManager
|
||||
|
||||
|
||||
# Variable
|
@ -6,7 +6,7 @@ import time
|
||||
|
||||
# Internal utilities
|
||||
from .version import __version__, __author__, __title__
|
||||
from Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
|
||||
|
||||
# External library
|
@ -2,6 +2,7 @@
|
||||
|
||||
import os
|
||||
import json
|
||||
import httpx
|
||||
import logging
|
||||
from typing import Any, List
|
||||
|
||||
@ -20,15 +21,34 @@ class ConfigManager:
|
||||
def read_config(self) -> None:
|
||||
"""Read the configuration file."""
|
||||
try:
|
||||
|
||||
logging.info(f"Read file: {self.file_path}")
|
||||
logging.info(f"Reading file: {self.file_path}")
|
||||
|
||||
# Check if file exist
|
||||
if os.path.exists(self.file_path):
|
||||
with open(self.file_path, 'r') as f:
|
||||
self.config = json.load(f)
|
||||
logging.info("Configuration file loaded successfully.")
|
||||
|
||||
# Download config.json
|
||||
else:
|
||||
logging.info("Configuration file does not exist. Downloading...")
|
||||
url = "https://raw.githubusercontent.com/Lovi-0/StreamingCommunity/refs/heads/main/config.json"
|
||||
|
||||
with httpx.Client() as client:
|
||||
response = client.get(url)
|
||||
|
||||
if response.status_code == 200:
|
||||
with open(self.file_path, 'w') as f:
|
||||
f.write(response.text)
|
||||
|
||||
self.config = json.loads(response.text)
|
||||
logging.info("Configuration file downloaded and saved.")
|
||||
|
||||
else:
|
||||
logging.error(f"Failed to download configuration file. Status code: {response.status_code}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error reading configuration file: {e}")
|
||||
logging.error(f"Error reading configuration file: {e}")
|
||||
|
||||
def read_key(self, section: str, key: str, data_type: type = str) -> Any:
|
||||
"""Read a key from the configuration file.
|
@ -5,7 +5,7 @@ from logging.handlers import RotatingFileHandler
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
class Logger:
|
@ -5,8 +5,8 @@ import platform
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
# Variable
|
@ -23,7 +23,7 @@ import httpx
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.console import console
|
||||
from StreamingCommunity.Src.Util.console import console
|
||||
|
||||
|
||||
# Variable
|
||||
@ -384,11 +384,11 @@ class OsSummary():
|
||||
logging.info(f"Dependencies: ffmpeg {ffmpeg_version}, ffprobe {ffprobe_version}")
|
||||
|
||||
# Optional libraries versions
|
||||
optional_libraries = [line.strip() for line in open('requirements.txt', 'r', encoding='utf-8-sig')]
|
||||
"""optional_libraries = [line.strip() for line in open('requirements.txt', 'r', encoding='utf-8-sig')]
|
||||
optional_libs_versions = [self.get_library_version(lib) for lib in optional_libraries]
|
||||
|
||||
console.print(f"[cyan]Libraries[white]: [bold red]{', '.join(optional_libs_versions)}[/bold red]\n")
|
||||
logging.info(f"Libraries: {', '.join(optional_libs_versions)}")
|
||||
logging.info(f"Libraries: {', '.join(optional_libs_versions)}")"""
|
||||
|
||||
|
||||
|
@ -1,201 +1,204 @@
|
||||
# 10.12.23
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import glob
|
||||
import logging
|
||||
import platform
|
||||
import argparse
|
||||
import importlib
|
||||
from typing import Callable
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.console import console, msg
|
||||
from Src.Util._jsonConfig import config_manager
|
||||
from Src.Upload.update import update as git_update
|
||||
from Src.Util.os import os_summary
|
||||
from Src.Lib.TMBD import tmdb
|
||||
from Src.Util.logger import Logger
|
||||
|
||||
|
||||
# Config
|
||||
CLOSE_CONSOLE = config_manager.get_bool('DEFAULT', 'not_close')
|
||||
SHOW_TRENDING = config_manager.get_bool('DEFAULT', 'show_trending')
|
||||
|
||||
|
||||
def run_function(func: Callable[..., None], close_console: bool = False) -> None:
|
||||
"""
|
||||
Run a given function indefinitely or once, depending on the value of close_console.
|
||||
|
||||
Parameters:
|
||||
func (Callable[..., None]): The function to run.
|
||||
close_console (bool, optional): Whether to close the console after running the function once. Defaults to False.
|
||||
"""
|
||||
if close_console:
|
||||
while 1:
|
||||
func()
|
||||
else:
|
||||
func()
|
||||
|
||||
|
||||
def load_search_functions():
|
||||
modules = []
|
||||
loaded_functions = {}
|
||||
|
||||
# Traverse the Api directory
|
||||
api_dir = os.path.join(os.path.dirname(__file__), 'Src', 'Api', 'Site')
|
||||
init_files = glob.glob(os.path.join(api_dir, '*', '__init__.py'))
|
||||
|
||||
# Retrieve modules and their indices
|
||||
for init_file in init_files:
|
||||
|
||||
# Get folder name as module name
|
||||
module_name = os.path.basename(os.path.dirname(init_file))
|
||||
logging.info(f"Load module name: {module_name}")
|
||||
|
||||
try:
|
||||
# Dynamically import the module
|
||||
mod = importlib.import_module(f'Src.Api.Site.{module_name}')
|
||||
|
||||
# Get 'indice' from the module
|
||||
indice = getattr(mod, 'indice', 0)
|
||||
is_deprecate = bool(getattr(mod, '_deprecate', True))
|
||||
use_for = getattr(mod, '_useFor', 'other')
|
||||
|
||||
if not is_deprecate:
|
||||
modules.append((module_name, indice, use_for))
|
||||
|
||||
except Exception as e:
|
||||
console.print(f"[red]Failed to import module {module_name}: {str(e)}")
|
||||
|
||||
# Sort modules by 'indice'
|
||||
modules.sort(key=lambda x: x[1])
|
||||
|
||||
# Load search functions in the sorted order
|
||||
for module_name, _, use_for in modules:
|
||||
|
||||
# Construct a unique alias for the module
|
||||
module_alias = f'{module_name}_search'
|
||||
|
||||
try:
|
||||
|
||||
# Dynamically import the module
|
||||
mod = importlib.import_module(f'Src.Api.Site.{module_name}')
|
||||
|
||||
# Get the search function from the module (assuming the function is named 'search' and defined in __init__.py)
|
||||
search_function = getattr(mod, 'search')
|
||||
|
||||
# Add the function to the loaded functions dictionary
|
||||
loaded_functions[module_alias] = (search_function, use_for)
|
||||
|
||||
except Exception as e:
|
||||
console.print(f"[red]Failed to load search function from module {module_name}: {str(e)}")
|
||||
|
||||
return loaded_functions
|
||||
|
||||
|
||||
def initialize():
|
||||
|
||||
# Get start message
|
||||
start_message()
|
||||
|
||||
# Get system info
|
||||
os_summary.get_system_summary()
|
||||
|
||||
# Set terminal size for win 7
|
||||
if platform.system() == "Windows" and "7" in platform.version():
|
||||
os.system('mode 120, 40')
|
||||
|
||||
# Check python version
|
||||
if sys.version_info < (3, 7):
|
||||
console.log("[red]Install python version > 3.7.16")
|
||||
sys.exit(0)
|
||||
|
||||
# Attempting GitHub update
|
||||
try:
|
||||
git_update()
|
||||
print()
|
||||
except:
|
||||
console.log("[red]Error with loading github.")
|
||||
|
||||
# Show trending film and series
|
||||
if SHOW_TRENDING:
|
||||
tmdb.display_trending_films()
|
||||
print()
|
||||
tmdb.display_trending_tv_shows()
|
||||
print()
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
start = time.time()
|
||||
|
||||
# Create logger
|
||||
log_not = Logger()
|
||||
|
||||
# Load search functions
|
||||
|
||||
search_functions = load_search_functions()
|
||||
logging.info(f"Load module in: {time.time() - start} s")
|
||||
|
||||
# Create dynamic argument parser
|
||||
parser = argparse.ArgumentParser(description='Script to download film and series from the internet.')
|
||||
|
||||
color_map = {
|
||||
"anime": "red",
|
||||
"film_serie": "yellow",
|
||||
"film": "blue",
|
||||
"serie": "green",
|
||||
"other": "white"
|
||||
}
|
||||
|
||||
# Add dynamic arguments based on loaded search modules
|
||||
for alias, (_, use_for) in search_functions.items():
|
||||
short_option = alias[:3].upper()
|
||||
long_option = alias
|
||||
parser.add_argument(f'-{short_option}', f'--{long_option}', action='store_true', help=f'Search for {alias.split("_")[0]} on streaming platforms.')
|
||||
|
||||
# Parse command line arguments
|
||||
args = parser.parse_args()
|
||||
|
||||
# Mapping command-line arguments to functions
|
||||
arg_to_function = {alias: func for alias, (func, _) in search_functions.items()}
|
||||
|
||||
# Check which argument is provided and run the corresponding function
|
||||
for arg, func in arg_to_function.items():
|
||||
if getattr(args, arg):
|
||||
run_function(func)
|
||||
return
|
||||
|
||||
# Mapping user input to functions
|
||||
input_to_function = {str(i): func for i, (alias, (func, _)) in enumerate(search_functions.items())}
|
||||
|
||||
# Create dynamic prompt message and choices
|
||||
choice_labels = {str(i): (alias.split("_")[0].capitalize(), use_for) for i, (alias, (_, use_for)) in enumerate(search_functions.items())}
|
||||
|
||||
# Display the category legend in a single line
|
||||
legend_text = " | ".join([f"[{color}]{category.capitalize()}[/{color}]" for category, color in color_map.items()])
|
||||
console.print(f"[bold green]Category Legend:[/bold green] {legend_text}")
|
||||
|
||||
# Construct the prompt message with color-coded site names
|
||||
prompt_message = "[green]Insert category [white](" + ", ".join(
|
||||
[f"{key}: [{color_map[label[1]]}]{label[0]}[/{color_map[label[1]]}]" for key, label in choice_labels.items()]
|
||||
) + "[white])"
|
||||
|
||||
# Ask the user for input
|
||||
category = msg.ask(prompt_message, choices=list(choice_labels.keys()), default="0", show_choices=False, show_default=False)
|
||||
|
||||
# Run the corresponding function based on user input
|
||||
if category in input_to_function:
|
||||
run_function(input_to_function[category])
|
||||
else:
|
||||
console.print("[red]Invalid category.")
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
initialize()
|
||||
main()
|
||||
# 10.12.23
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import glob
|
||||
import logging
|
||||
import platform
|
||||
import argparse
|
||||
import importlib
|
||||
from typing import Callable
|
||||
|
||||
|
||||
# Internal utilities
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.console import console, msg
|
||||
from StreamingCommunity.Src.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Src.Upload.update import update as git_update
|
||||
from StreamingCommunity.Src.Util.os import os_summary
|
||||
from StreamingCommunity.Src.Lib.TMBD import tmdb
|
||||
from StreamingCommunity.Src.Util.logger import Logger
|
||||
|
||||
|
||||
# Config
|
||||
CLOSE_CONSOLE = config_manager.get_bool('DEFAULT', 'not_close')
|
||||
SHOW_TRENDING = config_manager.get_bool('DEFAULT', 'show_trending')
|
||||
|
||||
|
||||
def run_function(func: Callable[..., None], close_console: bool = False) -> None:
|
||||
"""
|
||||
Run a given function indefinitely or once, depending on the value of close_console.
|
||||
|
||||
Parameters:
|
||||
func (Callable[..., None]): The function to run.
|
||||
close_console (bool, optional): Whether to close the console after running the function once. Defaults to False.
|
||||
"""
|
||||
if close_console:
|
||||
while 1:
|
||||
func()
|
||||
else:
|
||||
func()
|
||||
|
||||
|
||||
def load_search_functions():
|
||||
modules = []
|
||||
loaded_functions = {}
|
||||
|
||||
# Traverse the Api directory
|
||||
api_dir = os.path.join(os.path.dirname(__file__), 'Src', 'Api', 'Site')
|
||||
init_files = glob.glob(os.path.join(api_dir, '*', '__init__.py'))
|
||||
|
||||
# Retrieve modules and their indices
|
||||
for init_file in init_files:
|
||||
|
||||
# Get folder name as module name
|
||||
module_name = os.path.basename(os.path.dirname(init_file))
|
||||
logging.info(f"Load module name: {module_name}")
|
||||
|
||||
try:
|
||||
# Dynamically import the module
|
||||
mod = importlib.import_module(f'StreamingCommunity.Src.Api.Site.{module_name}')
|
||||
|
||||
# Get 'indice' from the module
|
||||
indice = getattr(mod, 'indice', 0)
|
||||
is_deprecate = bool(getattr(mod, '_deprecate', True))
|
||||
use_for = getattr(mod, '_useFor', 'other')
|
||||
|
||||
if not is_deprecate:
|
||||
modules.append((module_name, indice, use_for))
|
||||
|
||||
except Exception as e:
|
||||
console.print(f"[red]Failed to import module {module_name}: {str(e)}")
|
||||
|
||||
# Sort modules by 'indice'
|
||||
modules.sort(key=lambda x: x[1])
|
||||
|
||||
# Load search functions in the sorted order
|
||||
for module_name, _, use_for in modules:
|
||||
|
||||
# Construct a unique alias for the module
|
||||
module_alias = f'{module_name}_search'
|
||||
|
||||
try:
|
||||
|
||||
# Dynamically import the module
|
||||
mod = importlib.import_module(f'StreamingCommunity.Src.Api.Site.{module_name}')
|
||||
|
||||
# Get the search function from the module (assuming the function is named 'search' and defined in __init__.py)
|
||||
search_function = getattr(mod, 'search')
|
||||
|
||||
# Add the function to the loaded functions dictionary
|
||||
loaded_functions[module_alias] = (search_function, use_for)
|
||||
|
||||
except Exception as e:
|
||||
console.print(f"[red]Failed to load search function from module {module_name}: {str(e)}")
|
||||
|
||||
return loaded_functions
|
||||
|
||||
|
||||
def initialize():
|
||||
|
||||
# Get start message
|
||||
start_message()
|
||||
|
||||
# Get system info
|
||||
os_summary.get_system_summary()
|
||||
|
||||
# Set terminal size for win 7
|
||||
if platform.system() == "Windows" and "7" in platform.version():
|
||||
os.system('mode 120, 40')
|
||||
|
||||
# Check python version
|
||||
if sys.version_info < (3, 7):
|
||||
console.log("[red]Install python version > 3.7.16")
|
||||
sys.exit(0)
|
||||
|
||||
# Attempting GitHub update
|
||||
try:
|
||||
git_update()
|
||||
print()
|
||||
except:
|
||||
console.log("[red]Error with loading github.")
|
||||
|
||||
# Show trending film and series
|
||||
if SHOW_TRENDING:
|
||||
tmdb.display_trending_films()
|
||||
print()
|
||||
tmdb.display_trending_tv_shows()
|
||||
print()
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
start = time.time()
|
||||
|
||||
# Create logger
|
||||
log_not = Logger()
|
||||
|
||||
# Load search functions
|
||||
|
||||
search_functions = load_search_functions()
|
||||
logging.info(f"Load module in: {time.time() - start} s")
|
||||
|
||||
# Create dynamic argument parser
|
||||
parser = argparse.ArgumentParser(description='Script to download film and series from the internet.')
|
||||
|
||||
color_map = {
|
||||
"anime": "red",
|
||||
"film_serie": "yellow",
|
||||
"film": "blue",
|
||||
"serie": "green",
|
||||
"other": "white"
|
||||
}
|
||||
|
||||
# Add dynamic arguments based on loaded search modules
|
||||
for alias, (_, use_for) in search_functions.items():
|
||||
short_option = alias[:3].upper()
|
||||
long_option = alias
|
||||
parser.add_argument(f'-{short_option}', f'--{long_option}', action='store_true', help=f'Search for {alias.split("_")[0]} on streaming platforms.')
|
||||
|
||||
# Parse command line arguments
|
||||
args = parser.parse_args()
|
||||
|
||||
# Mapping command-line arguments to functions
|
||||
arg_to_function = {alias: func for alias, (func, _) in search_functions.items()}
|
||||
|
||||
# Check which argument is provided and run the corresponding function
|
||||
for arg, func in arg_to_function.items():
|
||||
if getattr(args, arg):
|
||||
run_function(func)
|
||||
return
|
||||
|
||||
# Mapping user input to functions
|
||||
input_to_function = {str(i): func for i, (alias, (func, _)) in enumerate(search_functions.items())}
|
||||
|
||||
# Create dynamic prompt message and choices
|
||||
choice_labels = {str(i): (alias.split("_")[0].capitalize(), use_for) for i, (alias, (_, use_for)) in enumerate(search_functions.items())}
|
||||
|
||||
# Display the category legend in a single line
|
||||
legend_text = " | ".join([f"[{color}]{category.capitalize()}[/{color}]" for category, color in color_map.items()])
|
||||
console.print(f"[bold green]Category Legend:[/bold green] {legend_text}")
|
||||
|
||||
# Construct the prompt message with color-coded site names
|
||||
prompt_message = "[green]Insert category [white](" + ", ".join(
|
||||
[f"{key}: [{color_map[label[1]]}]{label[0]}[/{color_map[label[1]]}]" for key, label in choice_labels.items()]
|
||||
) + "[white])"
|
||||
|
||||
# Ask the user for input
|
||||
category = msg.ask(prompt_message, choices=list(choice_labels.keys()), default="0", show_choices=False, show_default=False)
|
||||
|
||||
# Run the corresponding function based on user input
|
||||
if category in input_to_function:
|
||||
run_function(input_to_function[category])
|
||||
else:
|
||||
console.print("[red]Invalid category.")
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
def run():
|
||||
initialize()
|
||||
main()
|
||||
|
||||
if __name__ == '__main__':
|
||||
run()
|
@ -9,9 +9,9 @@ sys.path.append(src_path)
|
||||
|
||||
|
||||
# Import
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.logger import Logger
|
||||
from Src.Lib.Downloader import HLS_Downloader
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.logger import Logger
|
||||
from StreamingCommunity.Src.Lib.Downloader import HLS_Downloader
|
||||
|
||||
|
||||
# Test
|
||||
|
@ -9,9 +9,9 @@ sys.path.append(src_path)
|
||||
|
||||
|
||||
# Import
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.logger import Logger
|
||||
from Src.Lib.Downloader import MP4_downloader
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.logger import Logger
|
||||
from StreamingCommunity.Src.Lib.Downloader import MP4_downloader
|
||||
|
||||
|
||||
# Test
|
||||
|
@ -9,9 +9,9 @@ sys.path.append(src_path)
|
||||
|
||||
|
||||
# Import
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.logger import Logger
|
||||
from Src.Lib.Downloader import TOR_downloader
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.logger import Logger
|
||||
from StreamingCommunity.Src.Lib.Downloader import TOR_downloader
|
||||
|
||||
|
||||
# Test
|
||||
|
@ -9,9 +9,9 @@ sys.path.append(src_path)
|
||||
|
||||
|
||||
# Import
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.logger import Logger
|
||||
from Src.Api.Player.maxstream import VideoSource
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.logger import Logger
|
||||
from StreamingCommunity.Src.Api.Player.maxstream import VideoSource
|
||||
|
||||
|
||||
# Test
|
||||
|
@ -9,9 +9,9 @@ sys.path.append(src_path)
|
||||
|
||||
|
||||
# Import
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.logger import Logger
|
||||
from Src.Api.Player.supervideo import VideoSource
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.logger import Logger
|
||||
from StreamingCommunity.Src.Api.Player.supervideo import VideoSource
|
||||
|
||||
|
||||
# Test
|
||||
|
@ -9,9 +9,9 @@ sys.path.append(src_path)
|
||||
|
||||
|
||||
# Import
|
||||
from Src.Util.message import start_message
|
||||
from Src.Util.logger import Logger
|
||||
from Src.Api.Player.vixcloud import VideoSource
|
||||
from StreamingCommunity.Src.Util.message import start_message
|
||||
from StreamingCommunity.Src.Util.logger import Logger
|
||||
from StreamingCommunity.Src.Api.Player.vixcloud import VideoSource
|
||||
|
||||
|
||||
# Test
|
||||
|
@ -15,7 +15,7 @@ from rich.console import Console
|
||||
|
||||
|
||||
# Other import
|
||||
from Src.Api.Template.Class.SearchType import MediaManager
|
||||
from StreamingCommunity.Src.Api.Template.Class.SearchType import MediaManager
|
||||
|
||||
|
||||
# Variable
|
||||
@ -27,7 +27,7 @@ def load_search_functions():
|
||||
loaded_functions = {}
|
||||
|
||||
# Traverse the Api directory
|
||||
api_dir = os.path.join(os.path.dirname(__file__), '..', 'Src', 'Api', 'Site')
|
||||
api_dir = os.path.join(os.path.dirname(__file__), '..', 'StreamingCommunity', 'Src', 'Api', 'Site')
|
||||
init_files = glob.glob(os.path.join(api_dir, '*', '__init__.py'))
|
||||
|
||||
logging.info(f"Base folder path: {api_dir}")
|
||||
@ -42,7 +42,7 @@ def load_search_functions():
|
||||
|
||||
try:
|
||||
# Dynamically import the module
|
||||
mod = importlib.import_module(f'Src.Api.Site.{module_name}')
|
||||
mod = importlib.import_module(f'StreamingCommunity.Src.Api.Site.{module_name}')
|
||||
|
||||
# Get 'indice' from the module
|
||||
indice = getattr(mod, 'indice', 0)
|
||||
@ -67,7 +67,7 @@ def load_search_functions():
|
||||
|
||||
try:
|
||||
# Dynamically import the module
|
||||
mod = importlib.import_module(f'Src.Api.Site.{module_name}')
|
||||
mod = importlib.import_module(f'StreamingCommunity.Src.Api.Site.{module_name}')
|
||||
|
||||
# Get the search function from the module (assuming the function is named 'search' and defined in __init__.py)
|
||||
search_function = getattr(mod, 'search')
|
||||
|
33
setup.py
Normal file
33
setup.py
Normal file
@ -0,0 +1,33 @@
|
||||
from setuptools import setup
|
||||
|
||||
|
||||
def read_readme():
|
||||
with open("README.md", "r", encoding="utf-8") as fh:
|
||||
return fh.read()
|
||||
|
||||
with open("requirements.txt", "r", encoding="utf-8-sig") as f:
|
||||
required_packages = f.read().splitlines()
|
||||
print(required_packages)
|
||||
|
||||
setup(
|
||||
name="StreamingCommunity",
|
||||
version="1.7.3",
|
||||
long_description=read_readme(),
|
||||
long_description_content_type="text/markdown",
|
||||
author="Lovi-0",
|
||||
url="https://github.com/Lovi-0/StreamingCommunity",
|
||||
packages=["StreamingCommunity"],
|
||||
install_requires=required_packages,
|
||||
python_requires='>=3.8',
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
"streamingcommunity=StreamingCommunity.run:main",
|
||||
],
|
||||
},
|
||||
include_package_data=True,
|
||||
keywords="streaming community",
|
||||
project_urls={
|
||||
"Bug Reports": "https://github.com/Lovi-0/StreamingCommunity/issues",
|
||||
"Source": "https://github.com/Lovi-0/StreamingCommunity",
|
||||
}
|
||||
)
|
3
test_run.py
Normal file
3
test_run.py
Normal file
@ -0,0 +1,3 @@
|
||||
from StreamingCommunity.run import main
|
||||
|
||||
main()
|
@ -18,7 +18,7 @@ from rich.table import Table
|
||||
# Variable
|
||||
console = Console()
|
||||
local_path = os.path.join(".")
|
||||
from Src.Upload.version import __author__, __title__
|
||||
from StreamingCommunity.Src.Upload.version import __author__, __title__
|
||||
|
||||
|
||||
def move_content(source: str, destination: str):
|
Loading…
x
Reference in New Issue
Block a user