BasioMeusPuga / twitchy

CLI streamlink wrapper for twitch.tv
GNU General Public License v3.0
91 stars 14 forks source link

TypeError: 'NoneType' object is not subscriptable #38

Open Ecliptix opened 4 years ago

Ecliptix commented 4 years ago

I've been getting this error since a day or two ago when running twitchy, in any mode beyond configuration. Installed from the twitchy-git AUR package, which I also tried updating but that didn't help.

$ rm -rf ~/.config/twitchy3
$ twitchy --configure
 Configure:
 Media player [mpv]:
 Default stream quality [low/medium/HIGH/source]:
 Truncate stream status at [AUTO]:
 Interval (seconds) in between channel status checks [60]:

 Current Settings:
 Media player: mpv
 Default Quality: high
 Truncate status at: 0
 Check interval: 60
 Does this look correct to you? [Y/n]:
 Config written to /home/XXXXXX/.config/twitchy3/twitchy.cfg. Read for additional settings.

$ twitchy -a gogcom
 Additions to database:
Traceback (most recent call last):
  File "/usr/bin/twitchy", line 11, in <module>
    load_entry_point('twitchy==3.4.0', 'console_scripts', 'twitchy')()
  File "/usr/lib/python3.8/site-packages/twitchy/__main__.py", line 377, in main
    channel_addition('add', args.a)
  File "/usr/lib/python3.8/site-packages/twitchy/__main__.py", line 45, in channel_addition
    valid_channels = twitchy_api.name_id_translate(
  File "/usr/lib/python3.8/site-packages/twitchy/twitchy_api.py", line 87, in name_id_translate
    for i in stream_data['data']:
TypeError: 'NoneType' object is not subscriptable

$ twitchy -s XXXXXX
 Additions to database:
Traceback (most recent call last):
  File "/usr/bin/twitchy", line 11, in <module>
    load_entry_point('twitchy==3.4.0', 'console_scripts', 'twitchy')()
  File "/usr/lib/python3.8/site-packages/twitchy/__main__.py", line 404, in main
    channel_addition('sync', args.s)
  File "/usr/lib/python3.8/site-packages/twitchy/__main__.py", line 48, in channel_addition
    valid_channels = twitchy_api.sync_from_id(channels)
  File "/usr/lib/python3.8/site-packages/twitchy/twitchy_api.py", line 118, in sync_from_id
    username_id = name_id_translate(
  File "/usr/lib/python3.8/site-packages/twitchy/twitchy_api.py", line 87, in name_id_translate
    for i in stream_data['data']:
TypeError: 'NoneType' object is not subscriptable

$ sudo pacman -Qi twitchy-git
Name            : twitchy-git
Version         : r210.92e5176-1
Description     : CLI streamlink wrapper for twitch.tv
Architecture    : any
URL             : https://github.com/BasioMeusPuga/twitchy
Licenses        : GPL3
Groups          : None
Provides        : twitchy
Depends On      : python  streamlink  python-requests  python-setuptools
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : twitchy
Replaces        : None
Installed Size  : 155.72 KiB
Packager        : Unknown Packager
Build Date      : Mon 11 May 2020 11:03:55 AM MST
Install Date    : Mon 11 May 2020 11:04:00 AM MST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None
killarbyte commented 4 years ago

censured@jelezyaka:~/Documents/rpg-aria$ twitchy -a voodoosh Additions to database: Traceback (most recent call last): File "/usr/local/bin/twitchy", line 11, in load_entry_point('twitchy==3.4.0', 'console_scripts', 'twitchy')() File "/usr/local/lib/python3.8/dist-packages/twitchy-3.4.0-py3.8.egg/twitchy/main.py", line 377, in main channel_addition('add', args.a) File "/usr/local/lib/python3.8/dist-packages/twitchy-3.4.0-py3.8.egg/twitchy/main.py", line 45, in channel_addition valid_channels = twitchy_api.name_id_translate( File "/usr/local/lib/python3.8/dist-packages/twitchy-3.4.0-py3.8.egg/twitchy/twitchy_api.py", line 87, in name_id_translate for i in stream_data['data']: TypeError: 'NoneType' object is not subscriptable

BasioMeusPuga commented 4 years ago

Apparently twitch has started requiring OAuth authentication for all API requests. Let me take a look at this.

killarbyte commented 4 years ago

@BasioMeusPuga when i clean install streamlink - it fails to play any stream. After some research > when you change api key streamlink start working properly. Maybe you need to change this api key as well ? I tryed to change it in twitchy/twitchy_api.py under 'Client-ID': but it didnt help. Maybe im doing it wrong.

Hund commented 4 years ago

Well. This explains why no one has been streaming for a long as time. :)

Any progress?

CooperWallace commented 4 years ago

I've been able to solve this issue by generating a Personal Client-ID and Authorization token, and adding it with following to the twitchy-api.py file. These tokens can be generated using the guide https://dev.twitch.tv/docs/authentication

def api_call(url, params=None):
    try:
        headers = {
            'Client-ID': 'XXXX',
            'Authorization': 'Bearer XXX'
            }
Hund commented 4 years ago

I hope this project is still alive? It's to my understanding the only decent CLI client that doesn't require an account?

roceb commented 3 years ago

Project seems to be dead. Going to fork it and try to keep it alive

Hund commented 3 years ago

Project seems to be dead.

I have found an alternative; wtwitch. It's really good! :)

roceb commented 3 years ago

Project seems to be dead.

I have found an alternative; wtwitch. It's really good! :)

Actually, let me check it out. I got this to start working and thought about adding chat in terminal. But If this is better, then its less work for me. Thanks

Hund commented 3 years ago

Project seems to be dead.

I have found an alternative; wtwitch. It's really good! :)

Actually, let me check it out. I got this to start working and thought about adding chat in terminal. But If this is better, then its less work for me. Thanks

Cool! Where can we follow your endeavors? Are you on the fediverse?

roceb commented 3 years ago

Project seems to be dead.

I have found an alternative; wtwitch. It's really good! :)

Actually, let me check it out. I got this to start working and thought about adding chat in terminal. But If this is better, then its less work for me. Thanks

Cool! Where can we follow your endeavors? Are you on the fediverse?

I forked the project. Just follow me on here. Or watch my fork of it.

roceb commented 3 years ago

Edit to anyone coming here looking to solve their issue. I have a working version available right now.

Hund commented 3 years ago

Edit to anyone coming here looking to solve their issue. I have a working version available right now.

Your version is broken now.

roceb commented 3 years ago

Fixed, let me know. This seems to be an issue whenever twitch changes their API

Hund commented 3 years ago

Fixed, let me know. This seems to be an issue whenever twitch changes their API

Thanks! :) It would be easier if you would allow issues on your project as well.

Hund commented 3 years ago

Fixed, let me know. This seems to be an issue whenever twitch changes their API

It would be nice if you could make a release as well, it's how I keep myself updated with new updates. :)

roceb commented 3 years ago

Done, I'll start automatically deploying pushes to master as a release

Hund commented 3 years ago

Done, I'll start automatically deploying pushes to master as a release

Great! I updated to version 3.3.2 and it doesn't work. :/

roceb commented 3 years ago

Okay, I'll look into it. Twitch changes their API. I'll build and send a working version

On Fri, Apr 23, 2021, 08:51 Hund @.***> wrote:

Done, I'll start automatically deploying pushes to master as a release

Great! I updated to version 3.3.2 and it doesn't work. :/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BasioMeusPuga/twitchy/issues/38#issuecomment-825636617, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFC4R2VBSAFAWUBMV4JFGE3TKFUOLANCNFSM4M6R3RTA .

yuri0r commented 2 years ago

Okay, I'll look into it. Twitch changes their API. I'll build and send a working version

this must be anoying but it seems to be rebroken.