Closed jose1711 closed 7 years ago
fix for exashare parser
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
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
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
No activity for an extended period of time, closing.
This change is