youtube-dl: [linkedin:learning] can't download second section

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2019.03.09. If it’s not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I’ve verified and I assure that I’m running youtube-dl 2019.03.09

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple —) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

youtube-dl --proxy REDACTED@gmail.REDACTED@REDACTED.com:80 \
--username REDACTED@gmail.com --password REDACTED \
-f 'bestvideo[height<=720]+bestaudio/best[height<=720]' \
-o '%(playlist_title)s/Lesson %(chapter_number)02d - %(chapter)s/%(playlist_index)s - %(title)s.%(ext)s' --restrict-filenames --verbose --add-metadata --write-sub --limit-rate 2M --min-sleep-interval 5 --max-sleep-interval 10 \
"https://www.linkedin.com/learning/photoshop-cc-2018-essential-training-the-basics"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--proxy', u'REDACTED@gmail.com:REDACTED@REDACTED.com:80', u'--username', u'PRIVATE', u'--password', u'PRIVATE', u'-f', u'bestvideo[height<=720]+bestaudio/best[height<=720]', u'-o', u'%(playlist_title)s/Lesson %(chapter_number)02d - %(chapter)s/%(playlist_index)s - %(title)s.%(ext)s', u'--restrict-filenames', u'--verbose', u'--add-metadata', u'--write-sub', u'--limit-rate', u'2M', u'--min-sleep-interval', u'5', u'--max-sleep-interval', u'10', u'https://www.linkedin.com/learning/photoshop-cc-2018-essential-training-the-basics']
[debug] Encodings: locale ANSI_X3.4-1968, fs ANSI_X3.4-1968, out ANSI_X3.4-1968, pref ANSI_X3.4-1968
[debug] youtube-dl version 2019.03.09
[debug] Python version 2.7.15rc1 (CPython) - Linux-4.15.0-46-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.4, ffprobe 3.4.4
[debug] Proxy map: {u'http': u'REDACTED@gmail.com:REDACTED@REDACTED.com:80', u'https': u'REDACTED@gmail.com:REDACTED@REDACTED.com:80'}
[linkedin:learning:course] Downloading login page
[linkedin:learning:course] Logging in
[linkedin:learning:course] Downloading JSON metadata
[download] Downloading playlist: Photoshop CC 2018 Essential Training: The Basics
[linkedin:learning:course] playlist Photoshop CC 2018 Essential Training: The Basics: Collected 63 video ids (downloading 63 of them)
[download] Downloading video 1 of 63
[linkedin:learning] Downloading login page
[linkedin:learning] Logging in
[linkedin:learning] welcome: Downloading 360p JSON metadata
[linkedin:learning] welcome: Downloading 540p JSON metadata
[linkedin:learning] welcome: Downloading 720p JSON metadata
[linkedin:learning] welcome: Downloading m3u8 information
[debug] Invoking downloader on u'https://files3.lynda.com/secure/courses/625922/VBR_MP4h264_main_HD720/625922_00_01_WX30_welPSE.mp4?bZylE9zHX0NXuLt37pG5nguuMkfIbHyoUxOhh_NxW9t6Jcia74AuY3g8RvnSuNSTU9chCakoiJDJy1WIXJTnQ9ykPGWvquamgnYYZowPynjIMJL3z0bZijOTAP_GrQN9Hmtwg4-2D2Ybd6HyvoZTWUSD3MAWyCz1IOObmmPdmmubGNRCS0sI1g'
[download] Sleeping 7.10 seconds...
[download] Destination: Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/01 - Welcome.mp4
[download] 100% of 7.45MiB in 00:03
[ffmpeg] Adding metadata to 'Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/01 - Welcome.mp4'
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/01 - Welcome.mp4' -c copy -metadata 'date=20171005' -metadata 'purl=https://www.linkedin.com/learning/photoshop-cc-2018-essential-training-the-basics/welcome' -metadata 'title=Welcome' 'file:Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/01 - Welcome.temp.mp4'
[download] Downloading video 2 of 63
[linkedin:learning] what-you-should-know: Downloading 360p JSON metadata
[linkedin:learning] what-you-should-know: Downloading 540p JSON metadata
[linkedin:learning] what-you-should-know: Downloading 720p JSON metadata
[linkedin:learning] what-you-should-know: Downloading m3u8 information
[debug] Invoking downloader on u'https://files3.lynda.com/secure/courses/625922/VBR_MP4h264_main_HD720/625922_00_02_XR30_whatKnow.mp4?a3tBiueHfR3hvgwkhccZuVyQ_2sulkhNy1CdbY5MjCeQsMZPLF0BoHJsd7Zr1K0uxIRDV2JrYHaAIsDL9S6km_xwTWbsIT0iYqFpk1FJ3QFxEOKYcVWLqYtEz_fH6RtrWKQDhdKehNNsRSupcDy6_5EWgMP8Tst1ctaR9sGNXfII-Ub7ZPsazryX'
[download] Sleeping 6.67 seconds...
[download] Destination: Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/02 - What_you_should_know.mp4
[download] 100% of 661.78KiB in 00:00
[ffmpeg] Adding metadata to 'Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/02 - What_you_should_know.mp4'
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/02 - What_you_should_know.mp4' -c copy -metadata 'date=20171005' -metadata 'purl=https://www.linkedin.com/learning/photoshop-cc-2018-essential-training-the-basics/what-you-should-know' -metadata 'title=What you should know' 'file:Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/02 - What_you_should_know.temp.mp4'
[download] Downloading video 3 of 63
[linkedin:learning] using-the-exercise-files: Downloading 360p JSON metadata
[linkedin:learning] using-the-exercise-files: Downloading 540p JSON metadata
[linkedin:learning] using-the-exercise-files: Downloading 720p JSON metadata
[linkedin:learning] using-the-exercise-files: Downloading m3u8 information
[debug] Invoking downloader on u'https://files3.lynda.com/secure/courses/625922/VBR_MP4h264_main_HD720/625922_00_03_XR15_exFiles_519289.mp4?Y8vBhw2GaHpZH0vNNy029jVen0P54ARnb9jrCfBuF4h81i6bDDhWBnw3C8r2DbhErJwnT3phpJ2tZklkePg72Gdk9dSeG3Pgo-ZwujwgU6qi7uAX05-7QoxieTafN9lZTXve_1lfRPip_oCG3OlCXbfd8UOmPK1x0yW6RR-bm_neTDoWOB8DcGJNYGbK_g8y'
[download] Sleeping 7.69 seconds...
[download] Destination: Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/03 - Using_the_exercise_files.mp4
[download] 100% of 558.49KiB in 00:00
[ffmpeg] Adding metadata to 'Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/03 - Using_the_exercise_files.mp4'
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/03 - Using_the_exercise_files.mp4' -c copy -metadata 'date=20171005' -metadata 'purl=https://www.linkedin.com/learning/photoshop-cc-2018-essential-training-the-basics/using-the-exercise-files' -metadata 'title=Using the exercise files' 'file:Photoshop_CC_2018_Essential_Training_-_The_Basics/Lesson 01 - Introduction/03 - Using_the_exercise_files.temp.mp4'
[download] Downloading video 4 of 63
[linkedin:learning] opening-documents-in-photoshop: Downloading 360p JSON metadata
[linkedin:learning] opening-documents-in-photoshop: Downloading 540p JSON metadata
[linkedin:learning] opening-documents-in-photoshop: Downloading 720p JSON metadata
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 794, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 522, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/linkedin.py", line 126, in _real_extract
    self._sort_formats(formats, ('width', 'height', 'source_preference', 'tbr', 'abr'))
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1319, in _sort_formats
    raise ExtractorError('No video formats found')
ExtractorError: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

The formatting of the playlist_title is changed. The same with the title it didn’t always give you underscores in the filenames, just spaces. (Photoshop_CC_2018_Essential_Training_-_The_Basics) But the main issue is that it seems to download the first “section” of the videos just fine. But as soon as the new section begins it spits out this error.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 46 (2 by maintainers)

Commits related to this issue

Most upvoted comments

lyon667 already described above the main part, how to get this working again … . In case it’s not clear yet, I wrote a more detailed step by step instruction:

My problems were:

  • Could only download free public videos (e.g. only the 1st from a course, and got “ERROR: No video formats found” for the others).
  • Unable to use cookies (error “AttributeError: ‘unicode’ object has no attribute ‘items’”)
  • After fixing the --cookies error, still got the error “No video formats found”
  • FYI: I’m using an enterprise learning account (which is connected to my private linkedin account)

My workaround looks like this

C:\youtube-dl>python -m youtube_dl --cookies "cookies.txt" --add-header "x-li-identity:dX...Sk=" https://www.linkedin.com/learning/python-essential-training-2/hello-world

[linkedin:learning] hello-world: Downloading 360p JSON metadata
[linkedin:learning] hello-world: Downloading 540p JSON metadata
[linkedin:learning] hello-world: Downloading 720p JSON metadata
[linkedin:learning] hello-world: Downloading m3u8 information
[download] Destination: Hello world-687478.mp4
[download] 100% of 4.57MiB in 00:00

The essential part is: --cookies "cookies.txt" --add-header "x-li-identity:dX...Sk=" FYI:

  • No need for username/password on the command line.
  • The file cookies.txt + header value must be retrieved as described below.
  • I’m using the source code of youtube-dl, therefore python -m youtube_dl

Solution for --cookies error “AttributeError: ‘unicode’ object has no attribute ‘items’”

  • Simply update from Python2 to Python3.
  • Probably alternative solution for Python2: Edit source file “youtube_dl/extractor/common.py” as described here.

How to get a valid cookies.txt file

  • Install Firefox with this Plugin
  • Use Firefox to login to linkedin:learning
  • Play a learning video e.g. on this page.
  • Use the plugin to export the file cookies.txt

How to get the "x-li-identity” header value

  • In Firefox press Ctrl-Shift-E to open the Network Monitor (development console).
  • Reload the linkedin:learning page with the video.
  • In the Network Monitor, search for “/learning-api/detailedCourses”, and click on one of the lines with the HTTP requests.
  • On the right side, scroll down to the request header line “x-li-identity: …”, and copy the value to your command line option: --add-header “x-li-identity:…”

Guys, I was able to download using cookies after I uninstalled youtube-dl through pip and installed using pip3. In my machine, pip relates to python 2.7 and 'unicode' object has no attribute 'items' appears to be related with it.

Hi, I’m having the same issue as @scgreenhalgh described: my LI Learning access is not from a premium account but rather an “enterprise” one provided by a 3rd party which in my case is my employer. This basically lets me access the LinkedIn Learning via a single sign-on from outside LinkedIn itself (universities, companies, libraries, etc…) which is likely the cause of trouble.

I’ve been investigating the difference between what youtube-dl does now and how a browser behaves with the “enterprise” type of access and I’ve noticed it is all about just one missing extra header which can be seen through the browser’s network inspector: x-li-identity

It looks like this is some kind of base64 encoded string containing extra entreprise account information in a format: urn:li:enterpriseProfile:(urn:li:enterpriseAccount:<acc_number>,<unknown_number>) there are two numbers first of which seems to be an user ID while the other one’s meaning is so far unknown to me.

Anyway, to use this with youtube-dl it is possible to simply specify the header with --add-header flag and use the base64-encoded string retrieved from browser: youtube-dl --add-header x-li-identity:<base64-goes-here> --cookies cookies.txt https://www.linkedin.com/learning/aws-for-architects-network-and-storage-design

So far I was not able to figure out where this string actually comes from so if someone has more luck it would be great start for fixing this problem within the code.

Just curious about those people who are not even afraid of sharing their cookies! 😲

@scgreenhalgh That’s weird. It is downloading all of 'em on my side on 2019.09.12.1. Both courses.

Here’s what the command looks like: youtube-dl.exe --newline -u myemail@gmail.com -p mypassword -i -o "C:\Users\JohnDoe\Desktop\llearning_dl\%(playlist_index)s-%(title)s.%(ext)s" --ignore-config --hls-prefer-native --external-downloader aria2c.exe "https://www.linkedin.com/learning/fusion-360-essential-training-2"

and for the other, replace the last parameter with "https://www.linkedin.com/learning/learning-kubernetes"

image

Just was forcibly migrated from Lynda.com to LinkedIn learning. Seems now I am having the same issue mentioned above. I have linked together my university account and my personal LinkedIn and can browse and watch all the libraries without issue!

I tried downloading: https://www.linkedin.com/learning/fusion-360-essential-training-2/

First video downloads without issue, second video I get the same error as above. I have tried both cookies and regular login. Using 2019.09.12.1 with Python3 on OSX.

ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/Users/redacted/Dev/Python_virtualenvs/youtube-dl/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 796, in extract_info
    ie_result = ie.extract(url)
  File "/Users/redacted/Dev/Python_virtualenvs/youtube-dl/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/Users/redacted/Dev/Python_virtualenvs/youtube-dl/lib/python3.6/site-packages/youtube_dl/extractor/linkedin.py", line 127, in _real_extract
    self._sort_formats(formats, ('width', 'height', 'source_preference', 'tbr', 'abr'))
  File "/Users/redacted/Dev/Python_virtualenvs/youtube-dl/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 1327, in _sort_formats
    raise ExtractorError('No video formats found')
youtube_dl.utils.ExtractorError: No video formats found; please report this issue on https

having the same issue here, i run the command youtube-dl -v --cookies cookies.txt "https://www.linkedin.com/learning/solidworks-advanced-sketching/belt-chain"

and get the output

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--cookies', u'cookies.txt', u'https://www.linkedin.com/learning/solidworks-advanced-sketching/belt-chain']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.03.18
[debug] Python version 2.7.15 (CPython) - Darwin-18.2.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.1, ffprobe 4.1
[debug] Proxy map: {}
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/__init__.py", line 472, in main
    _real_main(argv)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/__init__.py", line 462, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 2006, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 794, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 529, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/linkedin.py", line 95, in _real_extract
    course_slug, 'selectedVideo', video_slug, height)['selectedVideo']
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/linkedin.py", line 34, in _call_api
    'Csrf-Token': self._get_cookies(api_url)['JSESSIONID'].value,
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 2816, in _get_cookies
    return compat_cookies.SimpleCookie(req.get_header('Cookie'))
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/Cookie.py", line 583, in __init__
    if input: self.load(input)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/Cookie.py", line 643, in load
    for k, v in rawdata.items():
AttributeError: 'unicode' object has no attribute 'items'

when i use user name and password cmmand youtube-dl --username "mail@gmail.com" --password "pass" --verbose --sleep-interval 120 "https://www.linkedin.com/learning/solidworks-advanced-sketching/belt-chain"

i get the below output

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--username', u'PRIVATE', u'--password', u'PRIVATE', u'--verbose', u'--sleep-interval', u'120', u'https://www.linkedin.com/learning/python-essential-training-2']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.03.18
[debug] Python version 2.7.15 (CPython) - Darwin-18.2.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.1, ffprobe 4.1
[debug] Proxy map: {}
[linkedin:learning:course] Downloading login page
[linkedin:learning:course] Logging in
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/__init__.py", line 472, in main
    _real_main(argv)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/__init__.py", line 462, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 2006, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 794, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 528, in extract
    self.initialize()
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 432, in initialize
    self._real_initialize()
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/linkedin.py", line 65, in _real_initialize
    data=urlencode_postdata(data))
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 793, in _download_webpage
    expected_status=expected_status)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 659, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 626, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 2225, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 421, in open
    protocol = req.get_type()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 283, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: /checkpoint/lg/login-submit