Skip to content

Instantly share code, notes, and snippets.

@jamesdeantv
jamesdeantv / youtubeplaylist.html
Created October 6, 2018 00:42 — forked from joniahola/youtubeplaylist.html
Simple youtube playlist-player. Only need to know youtube playlist url and insert to get-parameter 'url'. I found basic logic to find videos (if I remimber right) in this script snip: https://gist.github.com/906313
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<!-- Made by: Joni Ahola, 2012 -->
<!-- Easily embed youtube playlist: just add GET-parameter 'url' and youtube-playlist url -->
<!-- Example: filename.html?url=http://www.youtube.com/playlist?list=PLE5C2870574BF4B06 -->
<head profile="http://gmpg.org/xfn/11">
<style type="text/css">
/* placeholder inline styles */
@jamesdeantv
jamesdeantv / youtube-playlist.js
Created October 6, 2018 00:43 — forked from sammydigits/youtube-playlist.js
List videos in a YouTube playlist with jQuery
var playListURL = '//gdata.youtube.com/feeds/api/playlists/PLOGi5-fAu8bFt81BE77HOVzO4S4M1ZexJ?v=2&alt=json&callback=?';
jq.getJSON(playListURL, function (data) {
var list_data = "";
jq.each(data.feed.entry, function (i, item) {
var feedTitle = item.title.$t;
var feedURL = item.link[1].href;
var fragments = feedURL.split("/");
var videoID = fragments[fragments.length - 2];
var thumb = "//i1.ytimg.com/vi/" + videoID + "/mqdefault.jpg";
@jamesdeantv
jamesdeantv / README
Created October 6, 2018 00:44 — forked from mrspeaker/README
AI Class playlist generator
These are the scripts I use to create the playlists for the AI Class (available here: http://www.mrspeaker.net/2011/10/26/ai-class-playlists/). It's not pretty, but it works. I put them up here due to popular demand.
The first stage is to grab the video list HTML from YouTube and extract/sort the videos. This is done with the Video_ID_scraper.html file (instructions there).
Next, paste the video info into the YouTube_Playlist_Uploader.py script and it generates the playlist. It relies on the GData APIs so you need a dev key etc.
Any questions to mrspeaker@gmail.com
@jamesdeantv
jamesdeantv / youtube-dl.md
Created October 9, 2018 12:49 — forked from protrolium/youtube-dl.md
youtube-dl syntax

youtube-dl will output in the current directory

To list available formats

youtube-dl --list-formats URL

To download an entire user/channel

youtube-dl -citw ytuser:<USER> or

@jamesdeantv
jamesdeantv / youtube-dl.md
Created October 9, 2018 12:49
Using youtube-dl to download courses from Pluralsight

Download courses from learning sites with youtube-dl

You can download whole courses from an array of tutorial sites with the CLI tool youtube-dl. In the example further down I'm using my Pluralsight account to get videos from a course at their site. Here is a list of all supported sites that you can download from with this tool

The flags you have to supply may vary depending on which site you make a request to.

You can get a free 3 month trial to Pluralsight by signing up for free to Visual Studio Dev Essentials

Installation

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@jamesdeantv
jamesdeantv / youtube.sh
Created October 9, 2018 12:49 — forked from dantheman213/youtube-dl_cheatsheet.md
youtube-dl cheatsheet -- Download entire youtube playlist and more!
# https://github.com/rg3/youtube-dl/
# On ubuntu: apt-get install libav-tools
# Download Playlist to batch of MP3s
youtube-dl -f bestvideo+bestaudio --extract-audio --audio-format mp3 --prefer-avconv --playlist-random https://www.youtube.com/playlist?list=XXXXX
# Download individual song
youtube-dl -f bestvideo+bestaudio --extract-audio --audio-format mp3 --prefer-avconv https://www.youtube.com/watch?v=ZZZZZZZ

Download Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from Firefox (cookies.txt)[1] export extension. Save it to file cookies.txt

$ youtube-dl https://www.udemy.com/course-name/ --cookies ./cookies.txt > $ youtube-dl -u username -p password -o './videos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/course-name --cookies ./cookies.txt --verbose

@jamesdeantv
jamesdeantv / youtube-playlist.txt
Created October 9, 2018 12:50 — forked from ZubairLK/youtube-playlist.txt
Downloading all playlists of a user using youtube-dl khanacademy
youtube-dl is a nifty utility that can parse and download all user videos. Recently added a feature on downloading all playlists.
Here is a command that downloads all playlists of user KhanAcademyUrdu and puts all videos of each playlist in separate folders.
youtube-dl -ciw -f '(webm)[height<480]' -o '/media/zubairlk/part1/khanurdu/%(playlist)s/%(playlist_index)s_%(title)s_%(id)s.%(ext)s' --yes-playlist -R 10000 https://www.youtube.com/user/KhanAcademyUrdu/playlists
some explanation for later. see https://github.com/rg3/youtube-dl for full details.
-i is to ignore interrupts. timeouts/private videos etc block otherwise.
find . -name '*.png' -exec mv {} ../textures \;
find . -name '*.jpeg' -exec mv {} ../textures \;
find . -depth -type d -empty -exec rmdir {} \;