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

[Camsoda] Add new extractor #22036

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

[Camsoda] Add new extractor #22036

wants to merge 5 commits into from

Conversation

JChris246
Copy link
Contributor

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

###Add new extractor camsoda to download live streams from the site

@dstftw
Copy link
Collaborator

dstftw commented Aug 10, 2019

Does not work:

> py -3.7 .\youtube_dl\__main__.py https://www.camsoda.com/tifanny01 -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.camsoda.com/tifanny01', '-v']
[debug] Encodings: locale cp1251, fs utf-8, out utf-8, pref cp1251
[debug] youtube-dl version 2019.08.02
[debug] Git HEAD: e950312
[debug] Python version 3.7.0 (CPython) - Windows-10-10.0.10240-SP0
[debug] exe versions: ffmpeg N-85653-gb4330a0, ffprobe N-85653-gb4330a0, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[Camsoda] Downloading user data: tifanny01
ERROR: Unable to download JSON metadata: <urlopen error [WinError 10054] An existing connection was forcibly closed by the remote host> (caused by URLError(ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)))
  File "C:\Dev\youtube-dl\master\youtube_dl\extractor\common.py", line 627, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "C:\Dev\youtube-dl\master\youtube_dl\YoutubeDL.py", line 2229, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "C:\Python\Python37\lib\urllib\request.py", line 525, in open
    response = self._open(req, data)
  File "C:\Python\Python37\lib\urllib\request.py", line 543, in _open
    '_open', req)
  File "C:\Python\Python37\lib\urllib\request.py", line 503, in _call_chain
    result = func(*args)
  File "C:\Dev\youtube-dl\master\youtube_dl\utils.py", line 2724, in https_open
    req, **kwargs)
  File "C:\Python\Python37\lib\urllib\request.py", line 1319, in do_open
    raise URLError(err)

Also read coding conventions.

@JChris246
Copy link
Contributor Author

Im actually not sure why you are getting the error with that version of python, it works fine with the others ... i dont have that version to test so i would need help figuring that out

youtube_dl/extractor/camsoda.py Outdated Show resolved Hide resolved
youtube_dl/extractor/camsoda.py Outdated Show resolved Hide resolved
youtube_dl/extractor/camsoda.py Outdated Show resolved Hide resolved
stream_name=video_data['stream_name'],
token=video_data['token'])

formats = []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline.


user = user_data.get('user')
if user:
thumb = user.get('thumb') or user.get('profile_picture')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaks on non dict user.

corrected order of video id and note
changed str to compat_str
removed query from string and passed as var
changed str.format to old style %operator
check to make sure user is a dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants