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

Getting a Bad Request Error: 400 status code #8

Open
Yashraj-Gore opened this issue Sep 12, 2024 · 0 comments
Open

Getting a Bad Request Error: 400 status code #8

Yashraj-Gore opened this issue Sep 12, 2024 · 0 comments

Comments

@Yashraj-Gore
Copy link

So, I've cloned the repo, followed the instructions and given the url to the prompt. It throws a 400 bad request error:
Here's the stacktrace:

C:\Users\Striknas\AppData\Local\Microsoft\WindowsApps\python3.9.exe C:\Users\Striknas\PycharmProjects\audio-to-text-transcription\youtube_audio_to_text.py 
Enter the YouTube video URL: https://www.youtube.com/shorts/VEYX24bBOWA
Traceback (most recent call last):
  File "C:\Users\Striknas\PycharmProjects\audio-to-text-transcription\youtube_audio_to_text.py", line 35, in <module>
    audio_stream = yt.streams.filter(only_audio=True).first()
  File "C:\Users\Striknas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube\__main__.py", line 296, in streams
    return StreamQuery(self.fmt_streams)
  File "C:\Users\Striknas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube\__main__.py", line 176, in fmt_streams
    stream_manifest = extract.apply_descrambler(self.streaming_data)
  File "C:\Users\Striknas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube\__main__.py", line 160, in streaming_data
    self.bypass_age_gate()
  File "C:\Users\Striknas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube\__main__.py", line 257, in bypass_age_gate
    innertube_response = innertube.player(self.video_id)
  File "C:\Users\Striknas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube\innertube.py", line 448, in player
    return self._call_api(endpoint, query, self.base_data)
  File "C:\Users\Striknas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube\innertube.py", line 390, in _call_api
    response = request._execute_request(
  File "C:\Users\Striknas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube\request.py", line 37, in _execute_request
    return urlopen(request, timeout=timeout)  # nosec
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 523, in open
    response = meth(req, response)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 632, in http_response
    response = self.parent.error(
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 561, in error
    return self._call_chain(*args)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 494, in _call_chain
    result = func(*args)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 641, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

Process finished with exit code 1

Maybe anyone can share what could be done to fix this?
I have checked for latest pytube version as well as tried couple of other urls to see what's going wrong, but to no avail.

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

No branches or pull requests

1 participant