Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ciscolive] KeyError due to outdated rainfocus api keys and failing tests #30864

Open
6 tasks done
L0wbyte opened this issue Apr 17, 2022 · 2 comments · May be fixed by #30865
Open
6 tasks done

[ciscolive] KeyError due to outdated rainfocus api keys and failing tests #30864

L0wbyte opened this issue Apr 17, 2022 · 2 comments · May be fixed by #30865

Comments

@L0wbyte
Copy link

L0wbyte commented Apr 17, 2022

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2021.12.17
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

$ youtube-dl -v https://www.ciscolive.com/on-demand/on-demand-library.html?search=#/session/16360600004400017rMx
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.ciscolive.com/on-demand/on-demand-library.html?search=#/session/16360600004400017rMx']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.6.9 (CPython) - Linux-4.15.0-163-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.8, ffprobe 3.4.8
[debug] Proxy map: {}
[CiscoLiveSession] 16360600004400017rMx: Downloading webpage
ERROR: An extractor error has occurred. (caused by KeyError('items',)); 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/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/ciscolive.py", line 93, in _real_extract
    return self._parse_rf_item(rf_result['items'][0])
KeyError: 'items'
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/ciscolive.py", line 93, in _real_extract
    return self._parse_rf_item(rf_result['items'][0])
KeyError: 'items'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 547, in extract
    raise ExtractorError('An extractor error has occurred.', cause=e)
youtube_dl.utils.ExtractorError: An extractor error has occurred. (caused by KeyError('items',)); 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.

Description

Raising this bug report to submit (and link) a pull request fixing the issues with the ciscolive extractor outlined below:

youtube-dl fails to find valid video items for download when calling rainfocus api's (eg https://events.rainfocus.com/api/session).

# api response as captured with --dump-pages
{"responseCode":"104","responseMessage":"No session to display"}

after testing with various inputs this appears to be caused by invalid api tokens (these are currently static in the extractor, but have changed).
https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/ciscolive.py#L24-L25
these tokens have been present since the initial commit in Oct 2018 https://github.com/ytdl-org/youtube-dl/blob/05bd5e9c77e0e8acb95f47396be4c970fc9f39c4/youtube_dl/extractor/ciscolive.py
however, it may be more ideal to fetch these tokens 'live' just as a browser would.




additionally tests executed by

python test/test_download.py TestDownload.test_CiscoLiveSession
python test/test_download.py TestDownload.test_CiscoLiveSearch

both fail due to a mixture of the above problem, and the sessions/video's & search parameters referenced are no longer valid on the ciscolive site.

CiscoLiveSession
video's/sessions appear to eventually be removed/become inaccessible on the ciscolive site (likely after the technical material becomes less relevant after 3-4 years). The oldest searchable event appears to now be from 2018.
meaning session id's such as 1423353499155001FoSs (the test url for this class) results in a 104 - No session to display even if substituted into the new url format.
https://ciscolive.cisco.com/on-demand-library/?#/session/1423353499155001FoSs ->
https://www.ciscolive.com/on-demand/on-demand-library.html?search=#/session/1423353499155001FoSs
tests should be updated to pass and repeatable within the browser (the previous tests url's are no longer valid)

CiscoLiveSearch
old: https://ciscolive.cisco.com/on-demand-library/?search.event=ciscoliveus2018&search.technicallevel=scpsSkillLevel_aintroductory&search.focus=scpsSessionFocus_designAndDeployment#/
new: https://www.ciscolive.com/on-demand/on-demand-library.html?search.event=1636046385176005FbBU&search.technology=scpsTechnology_dataCenter&search.technicallevel=scpsSkillLevel_aintroductory#/
note search.event now contains id's 1636046385176005FbBU vs ciscoliveus2018
tests should be updated to pass and repeatable within the browser (the previous tests url's are no longer valid)




lastly the domain ciscolive.cisco.com is no longer valid for the site (dns returns an NXDOMAIN status) the correct domain is https://www.ciscolive.com/ and the url path has changed.

old: https://ciscolive.cisco.com/on-demand-library/?#/session/1423353499155001FoSs
new: https://www.ciscolive.com/on-demand/on-demand-library.html?search=#/session/16360600004400017rMx


i will submit a pull request to address these shortly.
@L0wbyte L0wbyte linked a pull request Apr 17, 2022 that will close this issue
11 tasks
@dirkf
Copy link
Contributor

dirkf commented Apr 18, 2022

Thanks!

@dirkf dirkf linked a pull request Apr 24, 2022 that will close this issue
11 tasks
@L0wbyte
Copy link
Author

L0wbyte commented May 14, 2024

reviving this fix after 2 years ;)
the cisco search api changed format for search results, so latest changes fix this.

additionally synced from master.

@dirkf mind taking a look and perhaps run the CI again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants