This commit is contained in:
Cyberes 2020-06-23 13:29:13 -06:00
parent e7fe739b49
commit 9c9fb37a0e
4 changed files with 13 additions and 4 deletions

View File

@ -25,6 +25,10 @@ Download, compress, and send your YouTube videos.
3. Install jq
1. `sudo apt-get install jq`
4. Install ffmpeg
1. `sudo apt install ffmpeg`
### Usage

View File

@ -67,6 +67,8 @@ fh.setFormatter(formatter)
logging.StreamHandler(stream=sys.stderr)
logger.addHandler(fh)
os.system('youtube-dl --rm-cache-dir')
# since youtube-dl updates so much check for updates
# if not args.no_update:
# print('checking for updates...')
@ -135,7 +137,7 @@ def checkSize(url):
def getUrls(playlist):
proc = subprocess.run(['bash', 'get-urls.sh', playlist], capture_output=True, encoding="utf-8")
if proc.stdout == '':
logger.error('missing get-urls.sh')
logger.error('')
print('missing get-urls.sh')
sys.exit(1)
if proc.stdout.find('get-urls.sh: line 1: jq: command not found') == -1:
@ -194,7 +196,7 @@ ydl_opts = {
'allsubtitles': True,
'logtostderr': True,
'format': ytdlFormat,
'outtmpl': 'downloads/%(title)s - %(id)s.%(ext)s',
'outtmpl': 'downloads/\'%(title)s\' - (\'%(uploader)s\' - \'%(uploader_id)s\') - %(id)s',
'postprocessors': [{
'key': 'FFmpegMetadata',
'key': 'EmbedThumbnail',
@ -203,8 +205,7 @@ ydl_opts = {
'logger': ytdlLogger(),
'progress_hooks': [my_hook],
}
ytdlCMD = 'youtube-dl -i --add-metadata --all-subs --embed-subs --embed-thumbnail -f "{}" --merge-output-format mkv -o "downloads/%(title)s - %(id)s.%(ext)s" --write-annotations --write-info-json --write-description --write-all-thumbnails --write-sub --sub-format "best" --geo-bypass'.format(
ytdlFormat)
ytdlCMD = 'youtube-dl -i --add-metadata --all-subs --embed-subs --embed-thumbnail -f "{}" --merge-output-format mkv -o "downloads/%(title)s - %(id)s.%(ext)s" --write-annotations --write-info-json --write-description --write-all-thumbnails --write-sub --sub-format "best" --geo-bypass'.format(ytdlFormat)
videoInc = 1
if not isURL:

2
pip-update.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U

2
start.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
python3 automated-youtube-dl.py https://www.youtube.com/playlist?list=PLTzznpqMc2tWxCHJYQ7mr7-6M_ZwzXIGW