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

[NBCSports] AttributeError: 'NoneType' object has no attribute 'startswith' #23503

Closed
ischmidt20 opened this issue Dec 24, 2019 · 0 comments
Closed
Labels

Comments

@ischmidt20
Copy link

@ischmidt20 ischmidt20 commented Dec 24, 2019

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2019.11.28
  • 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 issues including closed ones

Verbose log

youtube-dl -F https://www.nbcsports.com/video/leicester-citys-jamie-vardy-puts-his-side-front-v-everton -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-F', 'https://www.nbcsports.com/video/leicester-citys-jamie-vardy-puts-his-side-front-v-everton', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.11.28
[debug] Python version 3.7.0 (CPython) - Darwin-19.2.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.0.2, ffprobe 4.0.2, rtmpdump 2.4
[debug] Proxy map: {}
[NBCSports] leicester-citys-jamie-vardy-puts-his-side-front-v-everton: Downloading webpage
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/bin/youtube-dl", line 10, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl/__init__.py", line 474, in main
    _real_main(argv)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl/__init__.py", line 464, in _real_main
    retcode = ydl.download(all_urls)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 2018, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 807, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 851, in process_ie_result
    ie_result['url'] = sanitize_url(ie_result['url'])
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl/utils.py", line 2132, in sanitize_url
    if url.startswith('//'):
AttributeError: 'NoneType' object has no attribute 'startswith'

Description

Hey all,

Youtube-dl used to work excellently with NBC Sports videos, but now I see this AttributeError. It appears a similar issue happened here @13911, and someone else bumped the issue but no new ticket was opened.

Importantly, passing the embed URL directly into youtube-dl works just fine. In this case, youtube-dl -F 'vplayer.nbcsports.com/p/BxmELC/nbcsports_embed/select/media/iZywTFYJAWJa' works as expected:

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-F', 'vplayer.nbcsports.com/p/BxmELC/nbcsports_embed/select/media/iZywTFYJAWJa', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.11.28
[debug] Python version 3.7.0 (CPython) - Darwin-19.2.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.0.2, ffprobe 4.0.2, rtmpdump 2.4
[debug] Proxy map: {}
WARNING: The url doesn't specify the protocol, trying with http
[NBCSportsVPlayer] iZywTFYJAWJa: Downloading webpage
[ThePlatform] iZywTFYJAWJa: Downloading SMIL data
[ThePlatform] iZywTFYJAWJa: Checking video URL
[ThePlatform] iZywTFYJAWJa: Checking video URL
[ThePlatform] iZywTFYJAWJa: Checking video URL
[ThePlatform] iZywTFYJAWJa: Checking video URL
[ThePlatform] iZywTFYJAWJa: Checking video URL
[ThePlatform] iZywTFYJAWJa: Checking video URL
[ThePlatform] iZywTFYJAWJa: Checking video URL
[ThePlatform] iZywTFYJAWJa: Downloading JSON metadata
[info] Available formats for iZywTFYJAWJa:
format code  extension  resolution note
http-371     mp4        384x216     371k 
http-674     mp4        512x288     674k 
http-977     mp4        640x360     977k 
http-1481    mp4        768x432    1481k 
http-2289    mp4        1024x576   2289k 
http-4105    mp4        1280x720   4105k 
http-5618    mp4        1920x1080  5618k  (best)

You can find this embed URL by waiting for the ad to play and clicking on the video bar once it starts playing, but naturally I'd prefer to just pass in the main URL, especially because this functionality existed before.

Thanks!

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.