This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -euo pipefail | |
| if [ $# -lt 1 ] || [ -z "$1" ]; then | |
| echo "Usage: $0 <Youtube Channel URL> <--check-size?>" | |
| exit 1 | |
| fi | |
| CHANNEL_URL="$1" # Example `./download "https://www.youtube.com/@XXXXXXX/videos"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| yt-dlp -f "bv*[height=1080]+ba/best[height=1080]" \ | |
| -o "%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s" \ | |
| --merge-output-format mp4 \ | |
| --write-info-json --write-description --write-thumbnail --write-sub --embed-metadata --embed-thumbnail --embed-subs \ | |
| --download-archive archive.txt \ | |
| --playlist-reverse \ | |
| <CHANNEL_URL> | |
| # one line | |
| yt-dlp -f "bv*[height=1080]+ba/best[height=1080]" -o "%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s" --merge-output-format mp4 --write-info-json --write-description --write-thumbnail --write-sub --embed-metadata --embed-thumbnail --embed-subs --download-archive archive.txt --playlist-reverse <CHANNEL_URL> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Right click on the video ad. | |
| Select [Stats for nerds]. | |
| Open your developer browser console and paste this. | |
| source: https://stackoverflow.com/questions/20874062/how-to-download-video-ads-from-youtube | |
| */ | |
| alert("https://www.youtube.com/watch?v="+$(".html5-video-info-panel-content") | |
| .children[0] | |
| .children[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function isPrime(num) { | |
| var prime = num != 1; | |
| for(var i=2; i<num; i++) { | |
| if(num % i == 0) { | |
| prime = false; | |
| break; | |
| } | |
| } | |
| return prime; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function sleep(ms) { | |
| return new Promise(resolve => setTimeout(resolve, ms)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getElementByXpath(path) { | |
| return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
| } |