Coder Social home page Coder Social logo

twitch-chat-downloader's People

Contributors

alyoshavasilieva avatar gorrrg avatar jak0723 avatar petterkraabol avatar rosuav avatar thedrhax avatar thepaperpilot 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twitch-chat-downloader's Issues

Add support for Python 3.x

Traceback (most recent call last):
  File "app.py", line 165, in <module>
    for comment in Messages(video_id):
TypeError: iter() returned non-iterator of type 'Messages'

Handle common exceptions

  • Video with provided ID does not exist
  • API call failed (retry?)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/local/lib/python3.6/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.6/http/client.py", line 266, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 357, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.6/site-packages/urllib3/packages/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/local/lib/python3.6/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.6/http/client.py", line 266, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./generate.py", line 50, in <module>
    tcd.download(stream)
  File "/usr/local/lib/python3.6/site-packages/tcd/__init__.py", line 229, in download
    for comment in Messages(video_id):
  File "/usr/local/lib/python3.6/site-packages/tcd/__init__.py", line 90, in __next__
    self._load_more()
  File "/usr/local/lib/python3.6/site-packages/tcd/__init__.py", line 69, in _load_more
    response = self.client.get(url).json()
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 490, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
  • Failed to create file
  • ...

Cannot authenticate with clientID/secret.

Traceback (most recent call last):
  File "/home/doommaster/.local/bin/tcd", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/doommaster/.local/lib/python3.11/site-packages/tcd/__init__.py", line 46, in main
    download_all(args.channel, args.video_min,
  File "/home/doommaster/.local/lib/python3.11/site-packages/tcd/__init__.py", line 28, in download_all
    for video in videos:
  File "/home/doommaster/.local/lib/python3.11/site-packages/tcd/twitch.py", line 251, in videos
    res = gql(f'''
          ^^^^^^^^
  File "/home/doommaster/.local/lib/python3.11/site-packages/tcd/twitch.py", line 28, in gql
    raise Exception(res.text)
Exception: {"error":"Bad Request","status":400,"message":"The \"Client-ID\" header is invalid."}

This seems to be a common issue affecting some other GraphQL apps too :-(

it works without any credentials though (at least on the channel I used it on).

do you have a reference for the /comments endpoint?

This isn't an issue with your code or anything. I was just playing with it and was realizing the base_url using /videos/{id}/comments endpoint isn't documented at all at https://dev.twitch.tv/docs/v5

I know v5 is depreciated and will be removed 12/31/2018 but I was wondering if you had seen any documentation for this endpoint and could point me in the right direction.

Cheers

TypeError: 'NoneType' object is not subscriptable

I am on windows 10 pro 22H2 OS build 19045.2846
python -V - Python 3.11.3
pip3 show tdh-tcd
Name: tdh-tcd
Version: 2.5.2
Summary: Twitch Chat Downloader
Home-page: https://github.com/TheDrHax/Twitch-Chat-Downloader
Location: C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages
Requires: iso8601, progressbar2, requests

Error:

python -m tcd 1813289267
100% (15320 of 15320) |##############################################################| Elapsed Time: 0:00:10 ETA:  00:00:00Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\tcd\__main__.py", line 4, in <module>
    main()
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\tcd\__init__.py", line 44, in main
    download(args.video or args.video_id)
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\tcd\__init__.py", line 19, in download
    for comment in messages:
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\tcd\twitch.py", line 187, in __iter__
    hasNextPage = comments['pageInfo']['hasNextPage']
                  ~~~~~~~~^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
100% (15320 of 15320) |##############################################################| Elapsed Time: 0:00:11 Time:  0:00:11

In the same folder as I am running this program I have settings.json it's default that you generate with python -m tcd --generate-config the only thing I changed subtitle_duration is to increase the time to 4 seconds between each chat.

Here is the settings.json

{
  "version": "2.4.4",
  "client_id": "jzkbprff40iqj646a697cyrvl0zt2m6",
  "cooldown": 0,
  "display_progress": true,
  "formats": [
    "ass",
    "srt",
    "irc"
  ],
  "directory": "chats",
  "filename_format": "{directory}/v{video_id}.{format}",
  "max_width": -1,
  "subtitle_duration": 4,
  "dynamic_duration": {
    "enabled": false,
    "max": 5,
    "max_length": 100
  },
  "millisecond_separator": ",",
  "ssa_style_format": "Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding",
  "ssa_style_default": "Style: Default,Arial,20,16777215,16777215,16777215,-2147483640,-1,0,1,3,0,1,5,0,5,0,0",
  "ssa_events_format": "Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text",
  "ssa_events_line_format": "Dialogue: Marked=0, {start}, {end}, Default, {user}, 0000, 0000, 0000, , {user}: {message}",
  "group_repeating_emotes": {
    "enabled": false,
    "threshold": 3,
    "collocations": 5,
    "collocations_threshold": 2,
    "format": "{emote} x{count}"
  },
  "badges": {
    "enabled": false,
    "max_count": 1,
    "map": {
      "broadcaster": "~",
      "vip": "^",
      "staff": "&",
      "admin": "!",
      "global_mod": "*",
      "moderator": "@",
      "artist-badge": "|",
      "game-developer": "}",
      "founder": "#",
      "sub-gift-leader": "=",
      "sub-gifter": "-",
      "partner": ")",
      "bits": "$",
      "bits-charity": "$",
      "twitchbot": "?",
      "subscriber": "%",
      "premium": "+",
      "turbo": "+",
      "hype-train": "+",
      "no_video": "/",
      "no_audio": "/"
    }
  },
  "video_types": "archive"
}

It looks like the chat was downloaded successfully but it's still weird why I am getting this error. Any idea? Thanks for your hard work on this fork it's essential for my twitch chat processing.

KeyError: 'cooldown'

python 3.11.3, tdh-tcd latest

C:\Users\MyUser>python -m tcd 1821856251 --directory V:\ --formats srt

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "C:\Users\MyUser\AppData\Local\Programs\Python\Python311\Lib\site-packages\tcd\__init__.py", line 6, in <module>
    from .twitch import Messages, Channel
  File "C:\Users\MyUser\AppData\Local\Programs\Python\Python311\Lib\site-packages\tcd\twitch.py", line 8, in <module>
    from .settings import settings
  File "C:\Users\MyUser\AppData\Local\Programs\Python\Python311\Lib\site-packages\tcd\settings.py", line 202, in <module>
    args, unknown_args = _post_init_parser(help=False).parse_known_args()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\MyUser\AppData\Local\Programs\Python\Python311\Lib\site-packages\tcd\settings.py", line 82, in _post_init_parser
    '--cooldown', metavar='msec', type=int, default=settings['cooldown'],
                                                    ~~~~~~~~^^^^^^^^^^^^
KeyError: 'cooldown'

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.