def videoDownloader(string, passedTitle, yearVar):
# Options for the video downloader
ydl1_opts = {
'outtmpl': os.path.join(TheaterTrailersHome, 'Trailers', '{0} ({1})'.format(passedTitle, yearVar), '{0} ({1}).mp4'.format(passedTitle, yearVar)),
'ignoreerrors': True,
'format': 'mp4',
}
with youtube_dl.YoutubeDL(ydl1_opts) as ydl:
logger.info("downloading {0} from {1}".format(passedTitle, string))
ydl.download([string])
shutil.copy2(
os.path.join(trailerLocation, '{0} ({1})'.format(passedTitle, yearVar), '{0} ({1}).mp4'.format(passedTitle, yearVar)),
os.path.join(trailerLocation, '{0} ({1})'.format(passedTitle, yearVar), '{0} ({1})-trailer.mp4'.format(passedTitle, yearVar))
)
shutil.copy2(
os.path.join(TheaterTrailersHome, 'res', 'poster.jpg'),
os.path.join(trailerLocation, '{0} ({1})'.format(passedTitle, yearVar))
)
updatePlex()
# Downloads info for the videos from the playlist
评论列表
文章目录