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

[NowVideo] Extractor AttributeError: 'NoneType' object has no attribute 'to_screen' #6374

Closed
mrd1no opened this issue Jul 26, 2015 · 5 comments
Closed

Comments

@mrd1no
Copy link

@mrd1no mrd1no commented Jul 26, 2015

URL: http://www.nowvideo.li/video/7c345049b9419
OUTPUT:
Traceback (most recent call last):
File "info.py", line 39, in
NowVideoIE().extract(url)
File "C:\Python34\lib\site-packages\youtube_dl\extractor\common.py", line 275, in extract
return self._real_extract(url)
File "C:\Python34\lib\site-packages\youtube_dl\extractor\novamov.py", line 45, in _real_extract
'http://%s/video/%s' % (self._HOST, video_id), video_id, 'Downloading video page')
File "C:\Python34\lib\site-packages\youtube_dl\extractor\common.py", line 426, in _download_webpage
res = self._download_webpage_handle(url_or_request, video_id, note, errnote, fatal, encoding=encoding)
File "C:\Python34\lib\site-packages\youtube_dl\extractor\common.py", line 333, in _download_webpage_handle
urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal)
File "C:\Python34\lib\site-packages\youtube_dl\extractor\common.py", line 312, in _request_webpage
self.to_screen('%s: %s' % (video_id, note))
File "C:\Python34\lib\site-packages\youtube_dl\extractor\common.py", line 483, in to_screen
self._downloader.to_screen('[%s] %s' % (self.IE_NAME, msg))
AttributeError: 'NoneType' object has no attribute 'to_screen'

I tried to reproduce the error and debug it step by step, but I couldn't give any valid msg argument in line 483 to extractor/common.py

Thank you for your help in advance!

Mauro

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jul 26, 2015

Post the full output of youtube-dl when run with --verbose option.

@mrd1no
Copy link
Author

@mrd1no mrd1no commented Aug 3, 2015

Hi dstftw,

I reduced the script to the minimum to make it easier to debug:

[in]

from youtube_dl.extractor import NowVideoIE

url = "http://www.nowvideo.li/video/7c345049b9419"
NowVideoIE().initialize()
NowVideoIE().extract(url)

[out - from cmd shell using --verbose]

D:>python nowvideo.py --verbose
Traceback (most recent call last):
File "nowvideo.py", line 6, in
NowVideoIE().extract(url)
File "C:\Python34\lib\site-packages\youtube_dl\extractor\common.py", line 275,
in extract
return self._real_extract(url)
File "C:\Python34\lib\site-packages\youtube_dl\extractor\novamov.py", line 45,
in _real_extract
'http://%s/video/%s' % (self._HOST, video_id), video_id, 'Downloading video
page')
File "C:\Python34\lib\site-packages\youtube_dl\extractor\common.py", line 426,
in _download_webpage
res = self._download_webpage_handle(url_or_request, video_id, note, errnote,
fatal, encoding=encoding)
File "C:\Python34\lib\site-packages\youtube_dl\extractor\common.py", line 333,
in _download_webpage_handle
urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal)
File "C:\Python34\lib\site-packages\youtube_dl\extractor\common.py", line 312,
in _request_webpage
self.to_screen('%s: %s' % (video_id, note))
File "C:\Python34\lib\site-packages\youtube_dl\extractor\common.py", line 483,
in to_screen
self._downloader.to_screen('[%s] %s' % (self.IE_NAME, msg))
AttributeError: 'NoneType' object has no attribute 'to_screen'

Was it more helpful? May I do anything to make the investigation about this issue easier?

Thank you again!

Mauro

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 3, 2015

What are you trying to achieve? For embedding youtube-dl you should use it like that.

@mrd1no
Copy link
Author

@mrd1no mrd1no commented Aug 4, 2015

I was trying to download this video from nowvideo.

The idea it was to integrate this part of the code in another that is using selenium and lxml to collect the links to the episodes of a tv show.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Aug 4, 2015

Extractor are not designed to be used standalone, you can just do:

import youtube_dl

ydl_opts = {}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    info = ydl.extract_info(URL, download=False)
@jaimeMF jaimeMF closed this Aug 4, 2015
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
3 participants
You can’t perform that action at this time.