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

410 Client Error #142

Open
eugenechung81 opened this issue Dec 7, 2022 · 11 comments
Open

410 Client Error #142

eugenechung81 opened this issue Dec 7, 2022 · 11 comments

Comments

@eugenechung81
Copy link
Contributor

It looks like access to chat is gone for good?

(venv3) $ tcd --video 1671429796
JINGLEJAM 2022 DAY 5! OpenRA w/ Lewis, Duncan, Rythian, Spiff, Potato, & Ben
Traceback (most recent call last):
  File "/Users/eugene.chung/Developments/endorse/batch/download_chat/venv3/bin/tcd", line 8, in <module>
    sys.exit(main())
  File "/Users/eugene.chung/Developments/endorse/batch/download_chat/venv3/lib/python3.7/site-packages/tcd/__init__.py", line 89, in main
    Downloader().videos(Arguments().video_ids)
  File "/Users/eugene.chung/Developments/endorse/batch/download_chat/venv3/lib/python3.7/site-packages/tcd/downloader.py", line 183, in videos
    self.video(video)
  File "/Users/eugene.chung/Developments/endorse/batch/download_chat/venv3/lib/python3.7/site-packages/tcd/downloader.py", line 143, in video
    for formatted_comment, comment in comment_tuple:
  File "/Users/eugene.chung/Developments/endorse/batch/download_chat/venv3/lib/python3.7/site-packages/tcd/formats/custom.py", line 29, in comment_generator
    for comment in comments:
  File "/Users/eugene.chung/Developments/endorse/batch/download_chat/venv3/lib/python3.7/site-packages/twitch/v5/resources/comments.py", line 22, in __iter__
    fragment = self.fragment(fragment['_next'])
  File "/Users/eugene.chung/Developments/endorse/batch/download_chat/venv3/lib/python3.7/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 "/Users/eugene.chung/Developments/endorse/batch/download_chat/venv3/lib/python3.7/site-packages/twitch/api.py", line 111, in get
    return self.request('GET', path, ignore_cache, params=params, headers=self._headers(headers), **kwargs)
  File "/Users/eugene.chung/Developments/endorse/batch/download_chat/venv3/lib/python3.7/site-packages/twitch/api.py", line 100, in request
    response.raise_for_status()
  File "/Users/eugene.chung/Developments/endorse/batch/download_chat/venv3/lib/python3.7/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 410 Client Error: Gone for url: https://api.twitch.tv/v5/videos/1671429796/comments?cursor=
@tan5o
Copy link

tan5o commented Dec 7, 2022

I faced the same problem.
In the network log, the hidden api "https://api.twitch.tv/v5/videos/{video_id}/comments" is gone and seems to have migrated to GraphQL.

@garoto
Copy link

garoto commented Dec 7, 2022

Yep, seems v5 (kraken?) is gone for good now.

@NilsRudolf
Copy link

Same issue, sad. Any ideas how to get chat logs by streamer now ?

@smacz42
Copy link

smacz42 commented Dec 8, 2022

Yep, this is probably defunct for good.

Happy holidays y'all...

@churrodude666
Copy link

"If I hadn't seen such riches, I wouldn't feel so poor". I truly never appreciated how easy it was with this and twitchleecher, now both are unusable within a fortnight 🥲 I don't want to be that guy, but apparently @twitchdownloader is still working.. I know so little of what I'm doing, i can't even get windows to install it, but it could be a stopgap for anyone else who needs something

@LuminairPrime
Copy link

F in the chat for the great one with the great interface. :( Truly the best die young.

But no matter what annoying fuckery Twitch does with the API, public information will ALWAYS be scraped, one way or another. You can't stop the signal... ⚡😎

We rebuild, starting with lay295's https://github.com/lay295/TwitchDownloader

@churrodude666
Copy link

Anyone have a patch for this yet? Pretty much every other script for downloading chats is stable again, but none are as good as this. If i knew what I was doing, it'd probably be real simple.

@tan5o
Copy link

tan5o commented Dec 15, 2022

I have completely migrated to TwitchDownloader for my application.

I formatted the comment file as shown in the code below because the comment file saving format is different between Twitch-Chat-Downloader and TwitchDownloader.

# tcd version
def download_comment(video_id):
    if not os.path.exists(f"comments/{video_id}.txt"):
        subprocess.run(f'tcd --video {video_id} --client-id {client_id} --client-secret {secret_id} --output comments', shell=True)

# twitch downloader version
def download_comment_v2(video_id):
    if not os.path.exists(f"comments_cache/{video_id}.json"):
        subprocess.run(f'TwitchDownloaderCLI.exe chatdownload --id {video_id} -o comments_cache/{video_id}.json', shell=True)

    json_load = json.load(open(f"comments_cache/{video_id}.json",'r', encoding='UTF-8'))

    f = open(f"comments/{video_id}.txt", 'w', encoding='UTF-8')
    for comment in json_load['comments']:
        row = f"[{comment['content_offset_seconds']//3600:02.0f}:{comment['content_offset_seconds']//60%60:02.0f}:{comment['content_offset_seconds']%60:02.0f}]" + \
                f" <{comment['commenter']['display_name']}> {comment['message']['body']}\n"
        f.write(row)

I replaced the existing download_comment(video_id) with the download_comment_v2(video_id) and it works perfectly in my application.

@garoto
Copy link

garoto commented Dec 28, 2022

This fork is updated to work with the new API and GraphQL: https://github.com/TheDrHax/Twitch-Chat-Downloader

But be aware that TheDrHax added many options and changed other many options behaviors, so as far as I can tell, the fork and master are two different programs, so backup your previous settings.json just in case. Working good tho.

@charlie-collard
Copy link

charlie-collard commented Jan 4, 2023

Seems like this commit could easily be ported to the original repo. I don't really like the new CLI on the fork (no offense TheDrHax <3)

@vanyamlb
Copy link

vanyamlb commented Jan 16, 2023

Seems like this commit could easily be ported to the original repo. I don't really like the new CLI on the fork (no offense TheDrHax <3)

@bspammer @garoto

I installed it, but couldn't figure out how to get .txt files if that's possible

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

9 participants