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

video_id only from webpage #1965

Closed
ghost opened this issue Dec 14, 2013 · 6 comments
Closed

video_id only from webpage #1965

ghost opened this issue Dec 14, 2013 · 6 comments

Comments

@ghost
Copy link

@ghost ghost commented Dec 14, 2013

Hi,

I'm writing extractor plugin for czech tv.

I can get video_id only from loaded webpage, but _download_webpage requires video_id to work.

Can i make up some id or is there better way to solve this? Thanks

@ghost
Copy link
Author

@ghost ghost commented Dec 14, 2013

In common.py i see that video_id can be None

@ghost ghost closed this Dec 14, 2013
@phihag
Copy link
Contributor

@phihag phihag commented Dec 14, 2013

Please don't set the video id to None for video-specific downloads, None is intended to be used for extractor initialization (for example login or age confirmation). The video id can be anything and should be extracted from the URL.

@ghost
Copy link
Author

@ghost ghost commented Dec 14, 2013

Thanks @phihag . But i run into another problems with encoding

UnicodeEncodeError: 'charmap' codec can't encode character '\u2013' in position 9: character maps to <undefined>

If i use replace('\u2013', '-'), it works, but there are other errors with different chars 2026 etc...

@phihag
Copy link
Contributor

@phihag phihag commented Dec 14, 2013

@pulpe Can you give out the whole stacktrace? Pass in -v to see it if you aren't already.

@ghost
Copy link
Author

@ghost ghost commented Dec 14, 2013

@phihag Here is my extractor https://gist.github.com/pulpe/7959701

>python __main__.py http://play.iprima.cz/particka/particka-1012-gena -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['http://play.iprima.cz/particka/particka-1012-gena','-v']
[debug] youtube-dl version 2013.12.11.2
[debug] Python version 3.3.3 - Windows-XP-5.1.2600-SP3
[debug] Proxy map: {}
[IPrima] particka-1012-gena: Downloading webpage
[IPrima] particka-1012-gena: Downloading webpage
Traceback (most recent call last):
  File "__main__.py", line 18, in <module>
    youtube_dl.main()
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\__init__.py", line 723, in main
    _real_main(argv)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\__init__.py", line 713, in _real_main
    retcode = ydl.download(all_urls)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\YoutubeDL.py", line 877, in download
    self.extract_info(url)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\YoutubeDL.py", line 487, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\YoutubeDL.py", line 514, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\YoutubeDL.py", line 703, in process_video_result
    self.process_info(new_info)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\YoutubeDL.py", line 848, in process_info
    success = self.fd._do_download(filename, info_dict)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\FileDownloader.py", line 523, in _do_download
    info_dict.get('rtmp_conn', None))
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\FileDownloader.py", line 352, in _download_with_rtmpdump
    self.report_destination(filename)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\FileDownloader.py", line 205, in report_destination
    self.to_screen(u'[download] Destination: ' + filename)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\FileDownloader.py", line 132, in to_screen
    self.ydl.to_screen(*args, **kargs)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\YoutubeDL.py", line 247, in to_screen
    return self.to_stdout(message, skip_eol, check_quiet=True)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\YoutubeDL.py", line 258, in to_stdout
    write_string(output, self._screen_file)
  File "C:\Documents and Settings\pulpe\Dokumenty\Projekty\youtube-dl\youtube_dl\utils.py", line 852, in write_string
    out.write(s)
  File "C:\Python33\lib\encodings\cp852.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2013' in position 33: character maps to <undefined>
@ghost
Copy link
Author

@ghost ghost commented Dec 14, 2013

Tried google and found this https://pypi.python.org/pypi/Unidecode

This issue was closed.
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
1 participant
You can’t perform that action at this time.