Skip to content

Commit

Permalink
Fixed desync issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Metalloriff committed Nov 7, 2023
1 parent 56db270 commit 91d76f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# anime-downloader
A cross-platform CLI python script to download 1080p anime using animension.to

# Requirements
FFmpeg is required to use this tool.

# Installation and usage
`git clone https://github.com/Metalloriff/anime-downloader .`

Expand Down
10 changes: 6 additions & 4 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import os
import re
import shutil
import subprocess
import sys
from os import path, system

import m3u8_To_MP4
import requests
from alive_progress import alive_bar
from pyppeteer_stealth import stealth

clear = lambda: system("cls" if sys.platform == "win32" else "clear")

Expand Down Expand Up @@ -174,9 +173,12 @@ async def download():
for resolution in resolutions:
try:
m3u8_uri = ".".join(["/".join([uri_base, m3u8_path]), resolution, "m3u8"])
m3u8_To_MP4.multithread_download(m3u8_uri, mp4_file_dir=fp, mp4_file_name=fn)

cmd = f'ffmpeg -i "{m3u8_uri}" -safe 0 -y -async 100 -c copy "{os.path.join(fp, fn)}"'
process = subprocess.Popen(cmd, shell=True)

return
if process.wait() == 0:
return
except Exception as e:
print(e)
asyncio.run(download())
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
alive_progress==3.0.1
m3u8_To_MP4==0.1.11
requests==2.28.1

0 comments on commit 91d76f4

Please sign in to comment.