dr1818
Posts: 13
Joined: Sun Apr 20, 2014 2:28 pm

Getting newest video from YouTube?

Fri Jan 12, 2024 2:27 am

Once I have a URL, I can use youtube-dl...

I'm trying to download the latest news video, which is on the top video of a Facebook 'home' and 'video' page. I don't see the URL with curl, I gather it's on the webpage via JavaScript.

They have a podcast of the same news, but it's hours late.
Any ideas?

memjr
Posts: 3818
Joined: Fri Aug 21, 2020 5:59 pm

Re: Getting newest video from YouTube?

Fri Jan 12, 2024 6:26 am

If it's on FB, it's almost certain to be in JavaScript.

Open the page in a browser, find/scroll to the video and inspect the page's source.

dr1818
Posts: 13
Joined: Sun Apr 20, 2014 2:28 pm

Re: Getting newest video from YouTube?

Fri Jan 12, 2024 5:16 pm

mailbrother wrote:
Fri Jan 12, 2024 2:40 am
To download a video from Facebook, you can try using a tool like "youtube-dl" or similar utilities that support Facebook video downloading. It's my way.
Yes , but can't get that far without having the URL of the video on the page first.

dr1818
Posts: 13
Joined: Sun Apr 20, 2014 2:28 pm

Re: Getting newest video from YouTube?

Fri Jan 12, 2024 5:17 pm

memjr wrote:
Fri Jan 12, 2024 6:26 am
If it's on FB, it's almost certain to be in JavaScript.

Open the page in a browser, find/scroll to the video and inspect the page's source.
Yeah, but that's not an automatic process.
Thanks

memjr
Posts: 3818
Joined: Fri Aug 21, 2020 5:59 pm

Re: Getting newest video from YouTube?

Fri Jan 12, 2024 5:55 pm

dr1818 wrote:
Fri Jan 12, 2024 5:17 pm
memjr wrote:
Fri Jan 12, 2024 6:26 am
If it's on FB, it's almost certain to be in JavaScript.

Open the page in a browser, find/scroll to the video and inspect the page's source.
Yeah, but that's not an automatic process.
Thanks

I thought it was obvious but I'll clarify.

It is an automatic process once you write the script to perform the download.

But how and what do you need to download? The answer to that is:

memjr wrote:
Fri Jan 12, 2024 6:26 am
If it's on FB, it's almost certain to be in JavaScript.

Open the page in a browser, find/scroll to the video and inspect the page's source.

dr1818
Posts: 13
Joined: Sun Apr 20, 2014 2:28 pm

Re: Getting newest video from YouTube?

Sun Jan 14, 2024 11:30 pm

Okay thank you so there isn't some generic way of pulling the latest one. When has to actually go through the JavaScript or use a JavaScript web scraper...

Thanks

deepo
Posts: 1297
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Getting newest video from YouTube?

Wed Jan 17, 2024 1:17 pm

There are several guides on scraping web pages using e.g. Python, so you should be able to find the latest video under the videos tab.

retnuhflim
Posts: 2
Joined: Tue Feb 20, 2024 12:48 pm

Re: Getting newest video from YouTube?

Tue Feb 20, 2024 1:27 pm

Why such complexity if there are already services through which you can download videos?

For example, there is savefrom.net. Yes, it doesn’t work in the US now, but there is a VPN. We turn on VPN to any other country, for example, France - and voila, we can download any video by simply adding a link to the address bar of this service.

User avatar
scruss
Posts: 5825
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON

Re: Getting newest video from YouTube?

Tue Feb 20, 2024 6:31 pm

dr1818 wrote:
Fri Jan 12, 2024 2:27 am
Once I have a URL, I can use youtube-dl...
youtube-dl has been abandoned, and most video sites know how to block it. yt-dlp is its successor..

For sites that need a login to access pages (twitter, some Facebook videos) you'll likely need the '--cookies-from-browser firefox' (or name of whatever browser you use). This option tries to pick up session cookies from the currently running browser if it can.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

MiscBits
Posts: 2006
Joined: Wed Jan 27, 2021 12:48 pm

Re: Getting newest video from YouTube?

Wed Feb 21, 2024 1:01 pm

This popped up in my Feedly entries last night:

https://neilzone.co.uk/2024/02/download ... matically/

It uses ytdl-sub to drive yt-dlp via a configuration file.
I would tell you a joke about UDP but you may not get it.

Return to “Off topic discussion”