Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MoatazAbdAlmageed/47a2649ff2228a8a15b01a164f88de86 to your computer and use it in GitHub Desktop.
Save MoatazAbdAlmageed/47a2649ff2228a8a15b01a164f88de86 to your computer and use it in GitHub Desktop.
Download facebook videos
In brwoser console past this code
```
Array.prototype.unique = function() {
var a = [];
for (i = 0; i < this.length; i++) {
var current = this[i];
if (a.indexOf(current) < 0) a.push(current);
}
return a;
}
var urls = []
var parent = document.getElementById('pages_video_hub_all_videos_pagelet')
var child = parent.getElementsByTagName('a');
for (var i = 0; i < child.length; i++) {
urls.push("" + child[i].href +"")
}
newL = urls.toString().split(',')
Array.prototype.unique = function() {
return Array.from(new Set(this));
}
copy(urls.unique())
```
past your vids like this
for Item in "https://www.facebook.com/SheikhMinshawi/videos/2085159401757083/" "https://www.facebook.com/SheikhMinshawi/videos/2084049251868098/" "https://www.facebook.com/SheikhMinshawi/videos/1392149377724759/" ;
do
youtube-dl --extract-audio --audio-format mp3 $Item
done
@MoatazAbdAlmageed
Copy link
Author

MoatazAbdAlmageed commented Jul 28, 2018

var copyToClipboard = function copyToClipboard(str) {
  var el = document.createElement('textarea');
  el.value = str;
  el.setAttribute('readonly', '');
  el.style.position = 'absolute';
  el.style.left = '-9999px';
  document.body.appendChild(el);
  el.select();
  document.execCommand('copy');
  document.body.removeChild(el);
};


// --------------------------------------



Array.prototype.unique = function() {
    var a = [];
    for (i = 0; i < this.length; i++) {
        var current = this[i];
        if (a.indexOf(current) < 0) a.push(current);
    }
    return a;
}


var urls = [] 
var parent = document.getElementById('pages_video_hub_all_videos_pagelet')
var child = parent.getElementsByTagName('a');
for (var i = 0; i < child.length; i++) {
 urls.push("" + child[i].href  +"")
}

var newL = urls.toString().split(',')



Array.prototype.unique = function() {
    return Array.from(new Set(this));
}


copyToClipboard(urls.unique());
console.log("Done")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment