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

Periscope // Unable to download JSON metadata: HTTP Error 400: Bad Request #24952

Closed
JCGithu opened this issue Apr 22, 2020 · 1 comment
Closed

Periscope // Unable to download JSON metadata: HTTP Error 400: Bad Request #24952

JCGithu opened this issue Apr 22, 2020 · 1 comment

Comments

@JCGithu
Copy link

@JCGithu JCGithu commented Apr 22, 2020

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Hi, I've searched through every response I could find regarding this issue but couldn't seem to find anything concrete. For clarity, the issue is NOT that this happens every single time, but that it seems to only be happening on one account and only via packaged python?

URL in question: https://www.pscp.tv/10DowningStreet/1BRJjQvAPpgGw

I am trying to grab the .m3u8 stream urls from this account everyday. In command-line this is simple as I'm just running with the -g command. This works fine. When I run this URL through the python code in below it also produces the URL just fine. However, when I run through once the code has been packaged with pyinstaller I am getting a 400 Error.

If this were happening with all periscope URLs it would be understandable, but it is just this account.

I've included the minimal STDOUT just as proof the code is recieving the right URL.

Version: 2020.3.24

STDOUT:
[periscope] 1BRJjQvAPpgGw : Downloading JSON metadata the finalurl recieved is: https://www.pscp.tv/10DowningStreet/1BRJjQvAPpgGw

Python code:
ydl_opts = {
'cachedir': False,
'geo_bypass': True,
'forceurl': True,
}

        with youtube_dl.YoutubeDL(ydl_opts) as ydl:
            r = ydl.extract_info(finalurl, False)
            print (r['formats'][-1]['url'])

        sys.stdout.flush()

ERROR:
ERROR: Unable to download JSON metadata: HTTP Error 400: Bad Request (caused by <HTTPError 400: 'Bad Request'>); 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 "site-packages\youtube_dl\extractor\common.py", line 627, in _request_webpage
File "site-packages\youtube_dl\YoutubeDL.py", line 2238, in urlopen
File "urllib\request.py", line 531, in open
File "urllib\request.py", line 640, in http_response
File "urllib\request.py", line 569, in error
File "urllib\request.py", line 502, in _call_chain
File "urllib\request.py", line 649, in http_error_default
urllib.error.HTTPError: HTTP Error 400: Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages\youtube_dl\YoutubeDL.py", line 797, in extract_info
File "site-packages\youtube_dl\extractor\common.py", line 530, in extract
File "site-packages\youtube_dl\extractor\periscope.py", line 102, in _real_extract
File "site-packages\youtube_dl\extractor\periscope.py", line 16, in _call_api
File "site-packages\youtube_dl\extractor\common.py", line 888, in _download_json
File "site-packages\youtube_dl\extractor\common.py", line 867, in _download_json_handle
File "site-packages\youtube_dl\extractor\common.py", line 660, in _download_webpage_handle
File "site-packages\youtube_dl\extractor\common.py", line 645, in _request_webpage
youtube_dl.utils.ExtractorError: Unable to download JSON metadata: HTTP Error 400: Bad Request (caused by <HTTPError 400: 'Bad Request'>); 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.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "Extractor.py", line 506, in
File "dllive.py", line 40, in download
File "site-packages\youtube_dl\YoutubeDL.py", line 820, in extract_info
File "site-packages\youtube_dl\YoutubeDL.py", line 625, in report_error
File "site-packages\youtube_dl\YoutubeDL.py", line 595, in trouble
youtube_dl.utils.DownloadError: ERROR: Unable to download JSON metadata: HTTP Error 400: Bad Request (caused by <HTTPError 400: 'Bad Request'>); 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.

at ChildProcess.exithandler (child_process.js:308)
at ChildProcess.emit (events.js:210)
at maybeClose (internal/child_process.js:1021)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283)
@JCGithu JCGithu added the question label Apr 22, 2020
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 22, 2020

You must provide complete reproducible environment.

@dstftw dstftw closed this Apr 22, 2020
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.