Last active
April 26, 2019 14:02
-
-
Save Fraasi/bcb35d2733a0939034f5ed5f6446a951 to your computer and use it in GitHub Desktop.
Devtools snippet to easily get video links in certain video sites to copy paste to youtube-dl.
This file contains 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
iFrames = [] | |
iFramesInner = [] | |
filterOut = [ // does not work with YT-DL | |
"mycloud", | |
"vidzi", | |
"vidbull", | |
"fmoviesfree", | |
"vidcloud", | |
"streamcherry", | |
"vidup", | |
"vshare", | |
"thevideo" | |
] | |
Array.from(document.getElementsByTagName('iframe')) | |
.forEach((iframe) => { | |
let src = iframe.src | |
let filtered = filterOut.find(filter => src.includes(filter)) | |
filtered ? iFrames.push(`NO YT!: ${src}`) : iFrames.push(src) | |
if (iframe.contentDocument) { | |
let innerSrc = iframe.contentDocument.querySelector('iframe').src | |
let filtered = filterOut.find(filter => innerSrc.includes(filter)) | |
filtered ? iFramesInner.push(`NO YT!: ${innerSrc}`) : iFramesInner.push(innerSrc) | |
} | |
}) | |
console.log('Iframe source(s):') | |
iFrames.forEach(src => { console.log(src) }) | |
console.log('Iframe inner source(s):') | |
iFramesInner.forEach(src => { console.log(src) }) | |
//rewrite when you stumble upon a video tag again | |
console.log('Video source(s)') | |
videoTags = Array.from(document.getElementsByTagName('video')) | |
.forEach((el) => { | |
let source = 'No el.src || <source>' | |
if (el.src === '' && el.firstElementChild) { | |
source = el.firstElementChild.src | |
console.log('el.first...') | |
} else if (el.src) { | |
source = el.src | |
console.log('el.src') | |
} | |
console.log(source) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment