question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

404 Client Error: Not Found for url

See original GitHub issue

I was using tcd when this error happened:

xQcOW
BIG MOUNTAIN SIZED COLOSSAL MAN DESTROYS EVERYTHING IN ITS PARTH TO OBTAIN ETERNAL VICTORY. IMMORTAL GOLEM-LIKE HUMAN WINS AT ALL GAMES
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\timot\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\tcd.exe\__main__.py", line 7, in <module>
  File "C:\Users\timot\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tcd\__init__.py", line 92, in main
    Downloader().channels(Arguments().channels)
  File "C:\Users\timot\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tcd\downloader.py", line 195, in channels
    self.video(video)
  File "C:\Users\timot\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tcd\downloader.py", line 143, in video
    for formatted_comment, comment in comment_tuple:
  File "C:\Users\timot\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tcd\formats\custom.py", line 29, in comment_generator
    for comment in comments:
  File "C:\Users\timot\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twitch\v5\resources\comments.py", line 22, in __iter__
    fragment = self.fragment(fragment['_next'])
  File "C:\Users\timot\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twitch\v5\resources\comments.py", line 16, in fragment
    return self._api.get(self._path.format(video_id=self._video_id), params={'cursor': cursor})
  File "C:\Users\timot\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twitch\api.py", line 111, in get
    return self.request('GET', path, ignore_cache, params=params, headers=self._headers(headers), **kwargs)
  File "C:\Users\timot\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twitch\api.py", line 100, in request
    response.raise_for_status()
  File "C:\Users\timot\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\models.py", line 953, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.twitch.tv/v5/videos/1306930550/comments?cursor=

I’ve tried for other streamers as well, yet this error still pops up. Am I missing something? Or has the api been migrated somewhere else? Thank you very much in advance!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
m4ebacommented, Mar 1, 2022

got the same problem and made this quick fix for the Twitch-Python library

diff --git a/twitch/v5/resources/comments.py b/twitch/v5/resources/comments.py
index 0559edb..da69ffa 100644
--- a/twitch/v5/resources/comments.py
+++ b/twitch/v5/resources/comments.py
@@ -1,6 +1,7 @@
 from typing import Union, Generator
 
 import twitch.v5 as v5
+import requests
 from twitch.api import API
 from twitch.baseresource import BaseResource
 
@@ -13,7 +14,11 @@ class Comments(BaseResource['v5.Comment']):
         self._api = api
 
     def fragment(self, cursor: str = '') -> dict:
-        return self._api.get(self._path.format(video_id=self._video_id), params={'cursor': cursor})
+        # return self._api.get(self._path.format(video_id=self._video_id), params={'cursor': cursor})
+        headers = {'client-id': 'kimne78kx3ncx6brgo4mv6wki5h1ko' }
+        url = 'https://api.twitch.tv/v5/videos/{video_id}/comments?cursor={cursor}'.format(video_id=self._video_id,cursor=cursor)
+        data = requests.get(url, headers=headers).json()
+        return data
 
     def __iter__(self) -> Generator['v5.Comment', None, None]:
         fragment: dict = {'_next': ''}
2reactions
PetterKraabolcommented, May 1, 2022

Fixed in newest version

pip install tcd==3.2.2
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python requests package returning different HTTP status than ...
import requests >>> url = 'http://www.transfermarkt.com/' ... HTTPError: 404 Client Error: Not Found. Breaks as you've found out.
Read more >
HTTPError: 404 Client Error: Resource Not Found for url
Hi all, I recently got a Bing API Key for web search, and I'm using the code provided in the Github by Microsoft....
Read more >
HTTPError: 404 Client Error: Not Found for url · Issue #5086
Describe the bug. I was following chap 5 from huggingface course: https://huggingface.co/course/chapter5/6?fw=tf. However, I'm not able to ...
Read more >
Instrumentation and Data Management - Amplitude Community
404 Client Error: Not Found for url: https://amplitude.com/api/2/export ... This happened once on 1:25PM 08/15 but was successfully retried, then ...
Read more >
HTTP 404 - Wikipedia
In computer network communications, the HTTP 404, 404 not found, 404, 404 error, page not found or file not found error message is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found