mirror of
https://github.com/Araon/Meido.git
synced 2025-02-20 11:13:20 +08:00
added updateded on downloaderService
This commit is contained in:
parent
985499abb6
commit
c7938d144f
5
Pipfile
5
Pipfile
@ -8,8 +8,6 @@ verify_ssl = true
|
||||
[packages]
|
||||
python-telegram-bot = "==13.10"
|
||||
telegramclient = "*"
|
||||
telethon = "==1.24.0"
|
||||
backports-zoneinfo = "==0.2.1"
|
||||
cachetools = "==4.2.2"
|
||||
certifi = "==2021.10.8"
|
||||
pyaes = "==1.6.1"
|
||||
@ -22,6 +20,9 @@ tornado = "==6.1"
|
||||
tzdata = "==2021.5"
|
||||
tzlocal = "==4.1"
|
||||
APScheduler = "==3.6.3"
|
||||
ffmpeg = "*"
|
||||
Telethon = "==1.24.0"
|
||||
"backports.zoneinfo" = "==0.2.1"
|
||||
|
||||
[requires]
|
||||
python_version = "3.8"
|
||||
|
@ -1,4 +1,39 @@
|
||||
from animdl import *
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
def downloadVideo():
|
||||
pass
|
||||
def downloadVideo(search_query,search_query_range,search_quality):
|
||||
# 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:])
|
@ -1,16 +1,17 @@
|
||||
APScheduler==3.6.3
|
||||
backports.zoneinfo==0.2.1
|
||||
cachetools==4.2.2
|
||||
certifi==2021.10.8
|
||||
pyaes==1.6.1
|
||||
pyasn1==0.4.8
|
||||
python-telegram-bot==13.10
|
||||
pytz==2021.3
|
||||
pytz-deprecation-shim==0.1.0.post0
|
||||
rsa==4.8
|
||||
six==1.16.0
|
||||
Telethon==1.24.0
|
||||
tornado==6.1
|
||||
tzdata==2021.5
|
||||
tzlocal==4.1
|
||||
telethon==1.24.0
|
||||
python-telegram-bot=="13.10"
|
||||
telegramclient=="*"
|
||||
cachetools=="4.2.2"
|
||||
certifi=="2021.10.8"
|
||||
pyaes=="1.6.1"
|
||||
pyasn1=="0.4.8"
|
||||
pytz=="2021.3"
|
||||
pytz-deprecation-shim=="0.1.0.post0"
|
||||
rsa=="4.8"
|
||||
six=="1.16.0"
|
||||
tornado=="6.1"
|
||||
tzdata=="2021.5"
|
||||
tzlocal=="4.1"
|
||||
APScheduler=="3.6.3"
|
||||
ffmpeg = "*"
|
||||
Telethon=="1.24.0"
|
||||
"backports.zoneinfo"=="0.2.1"
|
Loading…
x
Reference in New Issue
Block a user