ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.2k stars 10.02k forks source link

LinkedIn supports only videos from linkedinLearning, but not from posts #31501

Open mumaguma opened 1 year ago

mumaguma commented 1 year ago

Checklist

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-f', 'best', 'https://www.linkedin.com/video/event/urn:li:ugcPost:7021048319078457345/', '--cookies', 'cookies_linkedin.txt']
[debug] Encodings: locale cp1250, fs mbcs, out cp852, pref cp1250
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: ffmpeg 2021-07-04-git-301d275301-full_build-www.gyan.dev, ffprobe 2021-07-04-git-301d275301-full_build-www.gyan.dev
[debug] Proxy map: {}
[generic] urn:li:ugcPost:7021048319078457345: Requesting header
WARNING: Falling back on generic information extractor.
[generic] urn:li:ugcPost:7021048319078457345: Downloading webpage
[generic] urn:li:ugcPost:7021048319078457345: Extracting information
ERROR: Unsupported URL: https://www.linkedin.com/video/event/urn:li:ugcPost:7021048319078457345/
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 815, in wrapper
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 836, in __extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\common.py", line 534, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\generic.py", line 3489, in _real_extract
youtube_dl.utils.UnsupportedError: Unsupported URL: https://www.linkedin.com/video/event/urn:li:ugcPost:7021048319078457345/

Description

It seems that Linkedin extractor supports only urls with "urn:li:lyndaCourse:", whereas videos in user/channel posts have "urn:li:ugcPost:" and are not recognised by youtube-dl.

dirkf commented 1 year ago

The problem page needs an account.

The yt-dlp LinkedIn extractor module has an extractor that works for /posts/... LinkedIn URLs (which needs to be back-ported).

Perhaps the problem page has the same structure. You can check this by searching the page source for an element like `<video ... data-sources="..." ...>. If that's present, we can just adjust the URL pattern in the back-port.

There should also be a check for redirecting to the sign-up page, which means you needed to log in.

dirkf commented 1 year ago

Also this URL format https://www.linkedin.com/feed/update/urn:li:activity:7016901149999955968 has the same page structure as /posts/....

mumaguma commented 1 year ago

The problem page needs an account. it there any way I could help? (excluding sharing my account / cookies.txt)

dirkf commented 1 year ago

This:

... searching the page source for an element like `<video ... data-sources="..." ...>.

mumaguma commented 1 year ago

I cannot find any "data-sources" occurrence. The only "<video" tag was: <video class="vjs-tech" id="vjs_video_3_html5_api" tabindex="-1" preload="metadata" poster="https://media.licdn.com/dms/image/C5624AQG3F3uWI9x3UQ/feedshare-live-thumbnail_high/0/1674752424731?e=1675652400&amp;v=beta&amp;t=q49vx7KlH8eeyZGizpIYwquG2bl-E09RDjBjThPYu6o" src="blob:https://www.linkedin.com/72705d44-517b-4e86-a4fb-0e0ee8b5b45d" autoplay="autoplay"></video>

Udhayarajan commented 1 year ago

https://github.com/Udhayarajan/VidSnapKit-Ultimate/blob/master/src/commonMain/kotlin/com/mugames/vidsnapkit/extractor/LinkedIn.kt

I have wrote code to download LinkedIn post downloader.

Also explore my cloud Services at https://rapidapi.com/mudhayarajan2013/api/vidsnap

From2750 commented 1 month ago

https://github.com/Udhayarajan/VidSnapKit-Ultimate/blob/master/src/commonMain/kotlin/com/mugames/vidsnapkit/extractor/LinkedIn.kt

I have wrote code to download LinkedIn post downloader.

Also explore my cloud Services at https://rapidapi.com/mudhayarajan2013/api/vidsnap

How do I use the script?