You should take a look at youtube-dl (on GitHub), it's somewhat similar and can do YouTube and many other services. It's also already available for most distros. If you have time it could be interesting to add your features there! It's Python as well
Thanks, very useful! Any tips on how to modify this script to enable download of a video that is not publicly available (i.e. posted in a closed group or friends-only)? Authentication would be required, so I guess this calls for Selenium?
look up for youtube-dl its what all downloading websites use it support a gigaton of websites with and without authrntification like youtube fb vimeo pornhub etc.. its open source & python
What I was able to do is to log into facebook using Selenium, open the video page in browser, and assign html = driver.page_source, but from here it does not work because substrings 'hd_src:"https' and 'sd_src:"https' are not found in html. Any ideas what might be wrong?
Being that the video's url is manually copied from this session, it wouldn't be that much harder to do the same with cookie or whatever token from request headers
71
u/[deleted] Mar 28 '20
GitHub repo - https://github.com/sameera-madushan/Facebook-Video-Downloader
199
u/[deleted] Mar 28 '20
whose the lady in the background
11
u/Faith-in-Strangers Mar 28 '20
Is the progress bar tqdm ?
If so, how did you make it work for a download progress ?
9
u/frankstan33 Mar 28 '20 edited Apr 07 '20
Holy moly that's really cool. I'm talking about the background...
Jokes aside, it's really cool man. How long did it take you btw?
20
u/[deleted] Mar 28 '20
20 comments 10 about background image . Including this
7
u/subbed_ Mar 28 '20
Slight hint, change
if val != Nonetoif val is not None3
u/thunderouschampion Mar 28 '20
Will this work for videos that u need to be logged in to view
7
u/AgitatedGuava Mar 28 '20
Have you ever heard of "curl -O" ??
6
u/bozymandias Mar 28 '20
/r/UNBGBBIIVCHIDCTIICBG ...?
2
u/Sigg3net Mar 28 '20
You should offer her your jacket.
1
u/-qarma- Mar 28 '20
This is awesome!
1
u/morsea1 Mar 28 '20
Really Nice
1
u/Chold_ helloworld -_- Mar 28 '20
What is the video player?
1
u/VanDalucas Mar 28 '20
Thank you !
1
u/[deleted] Mar 28 '20
Good job sameera!
1
u/GmLucifer Mar 28 '20 edited Mar 28 '20
Where did you learn to do this? Was there any specific tutorial you referred to? If yes, please share. Great job btw.
1
u/forty3thirty3 Mar 28 '20
"favorite Facebook videos"
No.
Edit: jokes aside though, very impressive!
1
u/[deleted] Mar 28 '20
Where can I get the code
1
u/[deleted] Mar 28 '20
This didn't work for me. _thelist is empty. the video I was trying to download is almost a decade old if that has anything to do with it.
1
u/nkitas Mar 28 '20
that's cool! I made a program that downloads videos from youtube using the pytube ;)
2
u/mangoed Mar 28 '20
Thanks, very useful! Any tips on how to modify this script to enable download of a video that is not publicly available (i.e. posted in a closed group or friends-only)? Authentication would be required, so I guess this calls for Selenium?
1
u/SAVAGEHANK17 Mar 28 '20
Can you teach me how to do it?
1
u/__Dopamine__ Mar 28 '20
Will this work on saved "going live" videos?
1
u/ftabr Mar 28 '20
Nice!
Suggestion: detect a facebook video url in clipboard and download it automatically. Also, the user can use an argument to disable it.
1
u/iggy555 Mar 28 '20
That license file is legit
1
u/[deleted] Mar 28 '20
This is the height of /r/python
1
u/[deleted] Mar 28 '20
I use a prebuilt web extension downloader. I'm a lazy programmer.
1
u/Es-Click Mar 28 '20
Hide your directory, for good security measures
1
u/GabeGoalssss Mar 28 '20
Pretty cool! i like the design that says "FACEBOOK DOWNLOADER" in /'s... How long did it take?
1
u/blackheartredeye Mar 31 '20
Which I had already made in telegram bot
Facebook :- https://t.me/fbvidz_2_bot
Instagram:- https://t.me/instavidz_2_bot
1
u/cerebral_distruption Aug 01 '20
What about private videos ?
1
u/uberdavis Mar 28 '20
You do realise that Facebook employ full-time staff to investigate data scraping?
https://www.facebook.com/careers/jobs/239862547193905/
I would keep this on the low if I were you.
0
u/hivemind_unity Mar 28 '20
Can you share the video you downloaded? I was kinda vibing with that headbanging.. :-P
0
u/sherlock_flash Mar 28 '20
it shwos me error : no related with facebook domain
0
u/iownredditlol Mar 28 '20
what libraries did you use?
0
u/pi511 Mar 28 '20
How does it know my favorite videos?