[utils] parse_resolution: Support width-only pattern (#13802)
Authored by: doe1080
This commit is contained in:
parent
485de69dbf
commit
4385480795
2 changed files with 6 additions and 0 deletions
|
|
@ -1875,6 +1875,11 @@ def parse_resolution(s, *, lenient=False):
|
|||
if mobj:
|
||||
return {'height': int(mobj.group(1)) * 540}
|
||||
|
||||
if lenient:
|
||||
mobj = re.search(r'(?<!\d)(\d{2,5})w(?![a-zA-Z0-9])', s)
|
||||
if mobj:
|
||||
return {'width': int(mobj.group(1))}
|
||||
|
||||
return {}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue