Python 2.7 - AttributeError: 'NoneType' object has no attribute 'strip'
Hello,
i am trying to decode one stream and push it to a player instead of watching it in a browser. I am using livestreamer for this purpose. Unfortunately I am getting error when i try it out: Code:
bash-4.2$ livestreamer hlsvariant://http://domain/path_to_playlist/playlist.m3u8 best Thanks! |
Well, it's really a bug in the livestreamer code.
They test to see if a playlist line matches... Code:
match = re.match("#(?P<tag>[\w-]+)(:(?P<value>.+))?", line) IMO, the line Code:
return match.group("tag"), match.group("value").strip() Code:
val = match.group("value") |
hello Richard Cranium,
thank you for your post. I think i got what the problem is. What i did not grasp is - should i by myself modify something in the code or not? And if yes, where and how should i do that? Or just wait and be patient until the livestreamer developers correct this error? thanks |
I'd send them the traceback along with a copy of your playlist (assuming that you don't mind someone else seeing it).
You could also change your playlist to match the pattern they *really* expect. As a last resort, you could change your copy of /usr/lib64/python2.7/site-packages/livestreamer/stream/hls_playlist.py to match what I wrote above. (I'm not certain that returning None for the tag's value would really work; it could just cause a problem somewhere else.) |
Hello again Richard Cranium,
thank you for posting. Of course i do not mind, you sending them my playlist. By the way i made the changes you had proposed but i got another error: Code:
Traceback (most recent call last): Thank you for your cooperation! |
It doesn't surprise me that my code change suggestion moved the error somewhere else. :)
Please note that I don't work on livestreamer code; I've just done a lot of python programming. |
Slackware 14.2 Upgrade
Hello,
i installed Slackware 14.2 and all optional and mandatory packages for livestreamer from Slackbuilds repository. I still get the error: Code:
[cli][info] Available streams: 142k (worst), 180p, 272p, 360p, 720p (best) |
Did you submit a bug report to the livestream developers the first time around? You should give them the traceback and your playlist so they can reproduce the problem.
I'll stress again that I don't work on livestream, nor do I use it. I will not submit a bug report on this. I looked closer at the livestreamer codebase, and I don't believe that the developers have seen a playlist with the entries that you have. (I think the livestream code base could use some unit tests to verify that the code can handle None return values in various places, but that's merely my opinion.) You can try the following, but I don't think that it will work: Edit the file /usr/lib64/python2.7/site-packages/livestreamer/stream/hls_playlist.py. On line 99, you will find the line.. Code:
match = re.match("#(?P<tag>[\w-]+)(:(?P<value>.+))?", line) The stuff marked out won't work and will simply result in the same error (moved to different line numbers) as the last time you tried. |
glupa4e, please submit an new issue on the livestreamer github page and tell them what you just told us.
This is a bug in livestreamer and it needs to be fixed by the developers. |
Hi Guys,
i have still not submitted an issue to Livestreamer. I thought one should be a developer to submit such issues but i am not. But if no one else wants to do that, i should create an account and try to describe the issue. |
Quote:
|
Quote:
|
|
Quote:
|
Thanks to GitHub developers
Changing Line 99 in the file
Code:
/usr/lib64/python2.7/site-packages/livestreamer/stream/hls_playlist.py Code:
match = re.match("#(?P[\w-]+)(:(?P.+))", line) |
All times are GMT -5. The time now is 01:38 AM. |