-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Download without rclone moving #3
Comments
If you need If you don't need 1. Create a directory to store the required files and downloaded videos (you can save videos elsewhere if you want, just modify the mkdir ~/youtube 2. Start a shell or bash instance for steps 3 and 4: sh 3. Create a cat > ~/youtube/config.conf << "EOF"
# File containing URLs to download, one URL per line. Lines starting with
# '#' or ';' or ']' are considered as comments and ignored.
--batch-file "~/youtube/urls.txt"
# Force resume of partially downloaded files. By default, youtube-dl will
# resume downloads if possible.
--continue
# Download only videos not listed in the archive file. Record the IDs of
# all downloaded videos in it.
--download-archive "~/youtube/archive.txt"
# Make all connections via IPv4
--force-ipv4
# Video format code
--format "bestvideo+bestaudio/best"
# Continue on download errors, for example to skip unavailable videos in a
# playlist.
--ignore-errors
# Do not overwrite files
--no-overwrites
# Output file template
--output "~/youtube/downloads/%(uploader)s/%(uploader)s.%(upload_date)s.%(title)s.%(resolution)s.%(id)s.%(ext)s"
# Restrict filenames to only ASCII characters, and avoid "&" and spaces
--restrict-filenames
# Subtitle format
--sub-format "srt/best"
# Subtitle language
--sub-lang "en"
# Write video description to a .description file
--write-description
# Write video metadata to a .info.json file
--write-info-json
# Write thumbnail image to disk
--write-thumbnail
# Write subtitle file
--write-sub
# Write automatically generated subtitle file (YouTube only)
--write-auto-sub
# Print various debugging information
#--verbose
EOF 4. Create the cat > ~/youtube/urls.txt << "EOF"
# Examples:
# ytuser:username
# https://www.youtube.com/user/username
# https://www.youtube.com/playlist?list=PLK9Sc5q_4K6aNajVLKtkaAB1JGmKyccf2
https://www.youtube.com/watch?v=J---aiyznGQ
EOF 5. Exit the shell or bash instance: exit 6. Test it: youtube-dl --config-location ~/youtube/config.conf If nothing went wrong, your youtube
├── archive.txt
├── config.conf
├── downloads
│ └── Keyboard_Cat
│ ├── Keyboard_Cat.20070607.Charlie_Schmidt_s_Keyboard_Cat_-_THE_ORIGINAL.320x240.J---aiyznGQ.description
│ ├── Keyboard_Cat.20070607.Charlie_Schmidt_s_Keyboard_Cat_-_THE_ORIGINAL.320x240.J---aiyznGQ.info.json
│ ├── Keyboard_Cat.20070607.Charlie_Schmidt_s_Keyboard_Cat_-_THE_ORIGINAL.320x240.J---aiyznGQ.jpg
│ └── Keyboard_Cat.20070607.Charlie_Schmidt_s_Keyboard_Cat_-_THE_ORIGINAL.320x240.J---aiyznGQ.mp4
└── urls.txt And the youtube J---aiyznGQ If you run 7. Everything look good? You're all done, unless you want to set up a cron job: # Every 6 hours
30 */6 * * * flock --nonblock /tmp/youtubedl.lock --command "youtube-dl --config-location ~/youtube/config.conf" Append # Every 6 hours; don't send output to syslog
30 */6 * * * flock --nonblock /tmp/youtubedl.lock --command "youtube-dl --config-location ~/youtube/config.conf" > /dev/null 2>&1 The Note: If you plan to download playlists that contain videos from different users, you may want to modify the - --output "~/youtube/downloads/%(uploader)s/%(uploader)s.%(upload_date)s.%(title)s.%(resolution)s.%(id)s.%(ext)s"
+ --output "~/youtube/downloads/%(playlist_title)s/%(uploader)s.%(upload_date)s.%(title)s.%(resolution)s.%(id)s.%(ext)s" Using
Using
One downside to using
And videos downloaded from a direct URL (https://www.youtube.com/watch?v=ID) are saved in a folder called Recap:
|
Good info. Thank you! |
Hi
Thank you for nice script.
Is there any way to remove rclone part, i just need to download youtube playlist to folder without moving anything...
The text was updated successfully, but these errors were encountered: