Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
95 user(s) are online (78 user(s) are browsing Forums)

Members: 1
Guests: 94

cygnusEd, more...
Support us!
Recent OS4 Files
OS4Depot.net
Report message:*
 

Re: Streaming twitch.tv on AmigaOS 4.1

Subject: Re: Streaming twitch.tv on AmigaOS 4.1
by jabirulo on 2019/9/20 11:59:13

@walkero

Is there a way to exit nicely when you type a non existant "twitch_channel" with -CV option?

FOOBAR234 channel doesn't exists:

#twitch.py -u https://www.twitch.tv/foobar234 -cv
aiostreams v1.3 (2019-09-20) - Developed by George Sokianos

HTTP Error 404: Not Found
URL Recorded at Available resolutions Title
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Traceback (most recent call last):
File "twitch.py", line 323, in <module>
main(sys.argv[1:])z
File "twitch.py", line 248, in main
for stream in streamList['videos']:
TypeError: 'NoneType' object is unsubscriptable
#

Very nice/usefull scripts!!!


EDIT:
maybe something like this (twitch.py:247):
...
        print 
"%s" % ('-'*200)
        if 
streamList:
            for 
stream in streamList['videos']:
                
resolutions ', '.join(stream['resolutions'])
                print 
"%-36st %-20st %-50st %s" % (stream['url'], stream['recorded_at'], resolutionscmnHandler.uniStrip(stream['title']))
        else:
            print 
"Channel '%s' doesn't exist." % (channelName)
...

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project