added updateded on downloaderService

This commit is contained in:
Ara0n 2022-01-14 03:10:56 +05:30
parent 985499abb6
commit c7938d144f
3 changed files with 58 additions and 21 deletions

View File

@ -8,8 +8,6 @@ verify_ssl = true
[packages] [packages]
python-telegram-bot = "==13.10" python-telegram-bot = "==13.10"
telegramclient = "*" telegramclient = "*"
telethon = "==1.24.0"
backports-zoneinfo = "==0.2.1"
cachetools = "==4.2.2" cachetools = "==4.2.2"
certifi = "==2021.10.8" certifi = "==2021.10.8"
pyaes = "==1.6.1" pyaes = "==1.6.1"
@ -22,6 +20,9 @@ tornado = "==6.1"
tzdata = "==2021.5" tzdata = "==2021.5"
tzlocal = "==4.1" tzlocal = "==4.1"
APScheduler = "==3.6.3" APScheduler = "==3.6.3"
ffmpeg = "*"
Telethon = "==1.24.0"
"backports.zoneinfo" = "==0.2.1"
[requires] [requires]
python_version = "3.8" python_version = "3.8"

View File

@ -1,4 +1,39 @@
from animdl import * import subprocess
import os
def downloadVideo(): def downloadVideo(search_query,search_query_range,search_quality):
pass # animdl download "demon slayer" -r 1
subprocess.run(['animdl', 'download',search_query,f'-r {str(search_query_range)}','--auto','-q',search_quality])
def getalltsfiles():
walk_dir = os.getcwd()
for root, _, files in os.walk(walk_dir):
for file in files:
if (file.split(".")[-1].lower() == 'ts'):
filePath = os.path.join(root, file)
mp4FilePath = os.path.join(root, os.path.splitext(file)[0] + ".mp4")
if os.path.isfile(mp4FilePath):
continue
return filePath, mp4FilePath
def convert2mp4(infile, outfile):
# ffmpeg -i E01.ts -c:v copy -c:a copy -preset:v ultrafast -segment_list_flags +live video.mp4
subprocess.run(['ffmpeg','-i',infile,'-c:v','copy','-c:a','copy','-preset:v','ultrafast','-segment_list_flags','+live',outfile])
def main(argv):
search_query = argv[1]
search_query_range = argv[2]
anime_quality = argv[3] if len(sys.argv) >= 4 else '720[subtitle]'
downloadVideo(search_query,search_query_range,anime_quality)
infile, outfile = getalltsfiles()
convert2mp4(infile,outfile)
os.remove(infile)
if __name__ == '__main__':
import sys
main(sys.argv[0:])

View File

@ -1,16 +1,17 @@
APScheduler==3.6.3 python-telegram-bot=="13.10"
backports.zoneinfo==0.2.1 telegramclient=="*"
cachetools==4.2.2 cachetools=="4.2.2"
certifi==2021.10.8 certifi=="2021.10.8"
pyaes==1.6.1 pyaes=="1.6.1"
pyasn1==0.4.8 pyasn1=="0.4.8"
python-telegram-bot==13.10 pytz=="2021.3"
pytz==2021.3 pytz-deprecation-shim=="0.1.0.post0"
pytz-deprecation-shim==0.1.0.post0 rsa=="4.8"
rsa==4.8 six=="1.16.0"
six==1.16.0 tornado=="6.1"
Telethon==1.24.0 tzdata=="2021.5"
tornado==6.1 tzlocal=="4.1"
tzdata==2021.5 APScheduler=="3.6.3"
tzlocal==4.1 ffmpeg = "*"
telethon==1.24.0 Telethon=="1.24.0"
"backports.zoneinfo"=="0.2.1"