Giter VIP home page Giter VIP logo

rechat-dl's Introduction

rechat-dl is a simple command-line tool to download the Chat Replay messages and metadata of Twitch VODs for archival purposes.

Installation

  1. Clone the repository or download the zip
  2. Install the requests library, if not yet installed: pip install requests

Notes

rechat-dl requires version 2.7+ of the Python interpreter. Its only dependency is requests.

Usage

rechat-dl.py VOD-ID [FILE]
	VOD-ID: can be found in the vod url like this:
	http://www.twitch.tv/streamername/v/{VOD-ID}

	FILE (optional): the file the chat messages will be saved into.
	if not set, it's rechat-{VOD-ID}.json

Output

The outputted .json file contains a json array, the first element of which is the VOD metadata (creation time, title, description, ...), followed by the Chat Replay messages. There's no documentation for the Chat Replay API yet, but its output is very similiar to the IRC interface.

This tool only downloads the chat messages, but doesn't offer a way to view them in real-time alongside a VOD.

License

This project is released under the Unlicense.

rechat-dl's People

Contributors

dustmop avatar makamys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rechat-dl's Issues

Twitch API for the initial video information request changed

vod_info = requests.get("https://api.twitch.tv/kraken/videos/v" + sys.argv[1], headers={"Client-ID": cid}).json()

To work as of today, the v5 video request needs some extra massaging:

auth = "OAuth ..." # token easily grabbed from browser devtools, I'm not sure how volatile or personalized this is
cid = "..." # also easily grabbed, needs to match auth above
vod_info = requests.get("https://api.twitch.tv/kraken/videos/v" + sys.argv[1], headers={"Accept": "application/vnd.twitchtv.v
5+json", "Client-ID": cid, "Authorization": auth}).json()

After this small update, the rest of the script worked perfectly to get me a chat transcript I was looking for a timestamp in ๐Ÿ˜Ž

Sub-only VOD

Is there a way to make this work with subscribers-only VODs? Any help will be appreciated!

Interrupted download

One download kept failing at random chunks (46/248, 115/248, 185/248) with the following error:

downloading chunk 185 / 248got an error in chat message response: {u'errors': [{u'status': 500, u'detail': u'[503] {"error":"ReduceSearchPhaseException[Failed to execute phase [fetch], [reduce] ]; nested: EsRejectedExecutionException[rejected execution (queue capacity 1000) on org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$2@4ea78e3a]; ","status":503}'}]}

Managed to download it after about 100 (!) tries.

Is there a way to have it retry/resume automatically upon such errors?
Or an unattended way to do this?

Thanks.

NewConnectionError while trying to download

error while downloading chunk #1: HTTPConnectionPool(host='rechat.twitch.tv', po
rt=80): Max retries exceeded with url: /rechat-messages?start=1502496578&video_i
d=v166276411 (Caused by NewConnectionError('<requests.packages.urllib3.connectio
n.HTTPConnection object at 0x03588D50>: Failed to establish a new connection: [E
rrno 11004] getaddrinfo failed',))

Same error all tries on VODs from two different channels.

Is the issue on my end?

Syntax error

I might be doing something wrong, but i just get a syntax error, whenever i'm trying to run the script.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.