kodi-czsk / script.module.stream.resolver

3 stars 25 forks source link

Fix parsing of exashare links w/o captions #34

Closed jose1711 closed 7 years ago

jose1711 commented 8 years ago

This change is Reviewable

jose1711 commented 8 years ago

fix for exashare parser

lubo commented 8 years ago

Review status: 0 of 1 files reviewed at latest revision, 2 unresolved discussions.


lib/server/exashareresolver.py, line 46 [r1] (raw file):

            for source in data['sources']:           
                if 'tracks' in data:                                                        
                    if data['tracks']:

These two if statements can be merge into a single one.


lib/server/exashareresolver.py, line 54 [r1] (raw file):

                                       })
                    else:
                        result=[{'url': source['file']}]

This logic seems kinda flowed to me. Are you sure you wanna rewrite result on every iteration ?


Comments from Reviewable

lubo commented 8 years ago

Review status: 0 of 1 files reviewed at latest revision, 3 unresolved discussions.


_lib/server/exashareresolver.py, line 40 [r1] (raw file):_

        data = data.group(1).decode('string_escape')
        data = re.sub(r'\w+\(([^\)]+?)\)', r'\1', data) # Strip JS functions
        data = re.sub(r''': *([^"'{\[][a-zA-Z]+)''',r':"\1"', data) # Fix incorrect JSON

What are these pairs of single quotes good for ? Shouldn't they be escaped ?


Comments from Reviewable

jose1711 commented 8 years ago

Review status: 0 of 1 files reviewed at latest revision, 3 unresolved discussions.


_lib/server/exashareresolver.py, line 40 [r1] (raw file):_ afaik, ''' has the same effect as """.

>>> print ("""foo'bar".""")
foo'bar".
>>> print ('''foo'bar".''')
foo'bar".

Comments from Reviewable

lubo commented 7 years ago

No activity for an extended period of time, closing.