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

Handle quotes in parse_stream_inf #13

Closed
audetto opened this issue Sep 26, 2012 · 2 comments
Closed

Handle quotes in parse_stream_inf #13

audetto opened this issue Sep 26, 2012 · 2 comments

Comments

@audetto
Copy link
Contributor

audetto commented Sep 26, 2012

Hi,
I've found a m3u8 file like that

EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=645000,RESOLUTION=512x288,CODECS="avc1.77.30, mp4a.40.5"

parse stream_inf line around 84 fails because it splits CODECS="avc1.77.30, mp4a.40.5" at the comma
CODECS="avc1.77.30,
mp4a.40.5"

I've tried to use csv, but it does not work, I think because the quoting is only for the part after = and not the whole string between , ,.

Any idea for an elegant solution?

@audetto
Copy link
Contributor Author

audetto commented Sep 26, 2012

This is my hack

def _parse_stream_inf(line, data, state):
    params_line = line.replace(ext_x_stream_inf + ':', '')
    params_line = params_line.replace('CODECS="', '"CODECS=')

    params = csv.reader([params_line])

    stream_info = {}
    for param in params.next():

@jbochi jbochi closed this as completed in bbf983f Sep 27, 2012
@jbochi
Copy link
Contributor

jbochi commented Sep 27, 2012

Thanks for reporting this issue. It was already solved in a fork and I have now merged the commit to master: feuvan@05e3471

@feuvan, thanks for your contribution. Feel free to send a pull request the next time :)

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

2 participants