diff --git a/cine.py b/cine.py deleted file mode 100644 index 39d49aa..0000000 --- a/cine.py +++ /dev/null @@ -1,33 +0,0 @@ -import argparse -import os - -from src.downloader import download_episode -from src.html_scraper import find_content_url - -# WORK IN PROGRESS - -ROOT = "" - -def main(): - parser = argparse.ArgumentParser(description="cine.to-Scraper") - - parser.add_argument( - "provider", - choices=["VOE", "Streamtape", "Vidoza"], - help="specify the provider of the content", - ) - parser.add_argument("title", type=str, help="title of the content") - parser.add_argument("url", type=str, help="url of the content") - - args = parser.parse_args() - file_name = f"{args.title}.mp4" - folder_name = os.path.join(ROOT, args.title) - os.makedirs(folder_name, exist_ok=True) - download_episode( - find_content_url(args.url, args.provider), - os.path.join(folder_name, file_name), - 0, - ) - -if __name__ == "__main__": - main() diff --git a/src/downloader.py b/src/downloader.py index 626b880..b35d789 100644 --- a/src/downloader.py +++ b/src/downloader.py @@ -1,5 +1,4 @@ import os -import platform import subprocess from src.logger import logger, SUCCESS @@ -18,15 +17,7 @@ def download_episode(url, file_name, episode, provider): ffmpeg_cmd = ["ffmpeg", "-headers", "Referer: https://d0000d.com/", "-i", url, "-c", "copy", "-nostdin", file_name] if provider == "Doodstream" \ else ["ffmpeg", "-i", url, "-c", "copy", "-nostdin", file_name] logger.info(f"Episode '{file_name}' added to queue.") - if platform.system() == "Windows": - subprocess.run(ffmpeg_cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - else: - subprocess.run( - ffmpeg_cmd, - check=True, - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - ) + subprocess.run(ffmpeg_cmd, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) logger.log(SUCCESS, f"Finished download of {file_name}.") return None except subprocess.CalledProcessError as e: