Skip to content

Instantly share code, notes, and snippets.

@hadees
Last active November 10, 2018 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hadees/5b19d719bb1e9de1df74885c2c9e12db to your computer and use it in GitHub Desktop.
Save hadees/5b19d719bb1e9de1df74885c2c9e12db to your computer and use it in GitHub Desktop.
// Run on https://www.youtube.com/user/foobar/playlists?view=1&shelf_id=0&sort=dd
function getParents(el, parentSelector /* optional */) {
// If no parentSelector defined will bubble up all the way to *document*
if (parentSelector === undefined) {
parentSelector = document;
}
var parents = [];
var p = el.parentNode;
while (p !== parentSelector) {
var o = p;
parents.push(o);
p = o.parentNode;
}
parents.push(parentSelector); // Push that parentSelector you wanted to stop at
return parents;
}
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js';
document.head.appendChild(s);
_.each(document.querySelectorAll('[title*="Bumpers"][id="video-title"]'), function(e) { console.log(getParents(e)[1].href + ' # ' + e.title) })
youtube-dl --download-archive downloaded.txt -i -o "%(playlist_title)s/%(title)s - %(uploader)s - %(upload_date)s - (%(duration)ss) [%(resolution)s].%(ext)s" -f bestvideo[ext=mp4]+bestaudio --batch-file=playlists.txt
http_proxy="91.194.42.51:80" youtube-dl --download-archive downloaded.txt -i -o "%(playlist_title)s/%(title)s - %(uploader)s - %(upload_date)s - (%(duration)ss) [%(resolution)s].%(ext)s" -f bestvideo[ext=mp4]+bestaudio --batch-file=playlists.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment