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

TypeError: 'NoneType' object is not subscriptable #38

Open
Ecliptix opened this issue May 12, 2020 · 20 comments
Open

TypeError: 'NoneType' object is not subscriptable #38

Ecliptix opened this issue May 12, 2020 · 20 comments

Comments

@Ecliptix
Copy link

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
Copy link

killarbyte commented May 12, 2020

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
Copy link
Owner

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

@killarbyte
Copy link

@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
Copy link

Hund commented May 28, 2020

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

Any progress?

@CooperWallace
Copy link

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
Copy link

Hund commented Oct 14, 2020

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

@roceb
Copy link

roceb commented Feb 25, 2021

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

@Hund
Copy link

Hund commented Feb 25, 2021

Project seems to be dead.

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

@roceb
Copy link

roceb commented Feb 25, 2021

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
Copy link

Hund commented Feb 25, 2021

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
Copy link

roceb commented Feb 26, 2021

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
Copy link

roceb commented Feb 26, 2021

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

@Hund
Copy link

Hund commented Apr 22, 2021

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

Your version is broken now.

@roceb
Copy link

roceb commented Apr 22, 2021

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

@Hund
Copy link

Hund commented Apr 22, 2021

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
Copy link

Hund commented Apr 22, 2021

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
Copy link

roceb commented Apr 22, 2021

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

@Hund
Copy link

Hund commented Apr 23, 2021

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
Copy link

roceb commented Apr 23, 2021 via email

@yuri0r
Copy link

yuri0r commented Mar 11, 2022

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.

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

7 participants