mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-07 12:05:35 +00:00
Animeunity upgrade
This commit is contained in:
parent
732507c14e
commit
389e7cec68
@ -119,10 +119,10 @@ class VideoSource:
|
|||||||
video_response = httpx.get(embed_url)
|
video_response = httpx.get(embed_url)
|
||||||
video_response.raise_for_status()
|
video_response.raise_for_status()
|
||||||
|
|
||||||
|
|
||||||
# Parse response with BeautifulSoup to get content of the scriot
|
# Parse response with BeautifulSoup to get content of the scriot
|
||||||
soup = BeautifulSoup(video_response.text, "html.parser")
|
soup = BeautifulSoup(video_response.text, "html.parser")
|
||||||
script = soup.find("body").find("script").text
|
script = soup.find("body").find("script").text
|
||||||
|
self.src_mp4 = soup.find("body").find_all("script")[1].text.split(" = ")[1].replace("'", "")
|
||||||
|
|
||||||
return script
|
return script
|
||||||
|
|
||||||
|
@ -1,19 +1,21 @@
|
|||||||
# 11.03.24
|
# 11.03.24
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
# Internal utilities
|
# Internal utilities
|
||||||
from Src.Util.console import console, msg
|
from Src.Util.console import console, msg
|
||||||
from Src.Lib.Downloader import HLS_Downloader
|
|
||||||
from Src.Util.message import start_message
|
from Src.Util.message import start_message
|
||||||
from ..Template import manage_selection
|
from Src.Util.os import create_folder, can_create_file
|
||||||
|
from Src.Lib.Downloader import MP4_downloader
|
||||||
|
|
||||||
|
|
||||||
# Logic class
|
# Logic class
|
||||||
from .Core.Player.vixcloud import VideoSource
|
from ..Template import manage_selection
|
||||||
from ..Template.Class.SearchType import MediaItem
|
from ..Template.Class.SearchType import MediaItem
|
||||||
|
from .Core.Player.vixcloud import VideoSource
|
||||||
|
|
||||||
|
|
||||||
# Variable
|
# Variable
|
||||||
@ -38,11 +40,11 @@ def download_episode(index_select: int):
|
|||||||
start_message()
|
start_message()
|
||||||
console.print(f"[yellow]Download: [red]EP_{obj_episode.number} \n")
|
console.print(f"[yellow]Download: [red]EP_{obj_episode.number} \n")
|
||||||
|
|
||||||
# Get the embed URL for the episode
|
# Get the js script from the episode
|
||||||
embed_url = video_source.get_embed(obj_episode.id)
|
js_script = video_source.get_embed(obj_episode.id)
|
||||||
|
|
||||||
# Parse parameter in embed text
|
# Parse parameter in embed text
|
||||||
video_source.parse_script(embed_url)
|
video_source.parse_script(js_script)
|
||||||
|
|
||||||
# Create output path
|
# Create output path
|
||||||
mp4_path = None
|
mp4_path = None
|
||||||
@ -52,10 +54,16 @@ def download_episode(index_select: int):
|
|||||||
else:
|
else:
|
||||||
mp4_path = os.path.join(ROOT_PATH, SITE_NAME, MOVIE_FOLDER, video_source.series_name)
|
mp4_path = os.path.join(ROOT_PATH, SITE_NAME, MOVIE_FOLDER, video_source.series_name)
|
||||||
|
|
||||||
|
# Check if can create file output
|
||||||
|
create_folder(mp4_path)
|
||||||
|
if not can_create_file(mp4_name):
|
||||||
|
logging.error("Invalid mp4 name.")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
# Start downloading
|
# Start downloading
|
||||||
HLS_Downloader(
|
MP4_downloader(
|
||||||
m3u8_playlist = video_source.get_playlist(),
|
str(video_source.src_mp4).strip(),
|
||||||
output_filename = os.path.join(mp4_path, mp4_name)
|
os.path.join(mp4_path, mp4_name)
|
||||||
).start()
|
).start()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
8
run.py
8
run.py
@ -16,7 +16,7 @@ from Src.Util.message import start_message
|
|||||||
from Src.Util.console import console, msg
|
from Src.Util.console import console, msg
|
||||||
from Src.Util._jsonConfig import config_manager
|
from Src.Util._jsonConfig import config_manager
|
||||||
from Src.Upload.update import update as git_update
|
from Src.Upload.update import update as git_update
|
||||||
from Src.Util.os import get_system_summary
|
from Src.Util.os import get_system_summary, create_folder
|
||||||
from Src.Lib.TMBD.tmbd import tmdb
|
from Src.Lib.TMBD.tmbd import tmdb
|
||||||
from Src.Util.logger import Logger
|
from Src.Util.logger import Logger
|
||||||
|
|
||||||
@ -138,6 +138,10 @@ def initialize():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
|
# Create folder root path if not exist
|
||||||
|
folder_root_path = config_manager.get("DEFAULT", "root_path")
|
||||||
|
create_folder(folder_name=folder_root_path)
|
||||||
|
|
||||||
# Load search functions
|
# Load search functions
|
||||||
search_functions = load_search_functions()
|
search_functions = load_search_functions()
|
||||||
|
|
||||||
@ -182,5 +186,5 @@ def main():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
initialize()
|
#initialize()
|
||||||
main()
|
main()
|
Loading…
x
Reference in New Issue
Block a user