Skip to content

Commit 1e13c00

Browse files
committed
Added special option for max video quality,
uses --format behind the scenes.
1 parent 344ef28 commit 1e13c00

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

utils/utilities.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from traceback import format_exception
1010
from winreg import ConnectRegistry, OpenKey, QueryValueEx, HKEY_CURRENT_USER
1111

12-
1312
LOG_FILE = 'Grabber_error.log'
1413

1514
log = logging.getLogger('Grabber')
@@ -89,12 +88,12 @@ def path_shortener(full_path: str):
8988
split = -integer - 1
9089
times += 1
9190
if times == 3 and full_path.count('/') >= 4:
92-
short_path = ''.join([full_path[:full_path.find('/')+1], '...', full_path[split:]])
91+
short_path = ''.join([full_path[:full_path.find('/') + 1], '...', full_path[split:]])
9392

9493
break
9594
elif times == 3:
9695
split = full_path.find('/', split)
97-
short_path = ''.join([full_path[:full_path.find('/')+1], '...', full_path[split:]])
96+
short_path = ''.join([full_path[:full_path.find('/') + 1], '...', full_path[split:]])
9897
break
9998
else:
10099
short_path = full_path
@@ -1003,6 +1002,16 @@ def _validate_settings(self):
10031002
"state": False,
10041003
"tooltip": "Username of your account. Password will be asked for on run."
10051004
}
1005+
base_settings['parameters']['Best video quality'] = {
1006+
"active option": 0,
1007+
"command": "--format ((571/272/402/337/315/313/401/336/308/400/271/335/303/299/399/137/248/334/302/298/398/247/136/333/244/135/397/332/243/134/396/331/242/133/395/330/160/394/278)[protocol!=http_dash_segments])+(bestaudio[acodec=opus]/bestaudio[protocol!=http_dash_segments])/best",
1008+
"dependency": None,
1009+
"options": None,
1010+
"state": False,
1011+
"tooltip": "This is a special command that uses --format"
1012+
"\nThis picks best possible video quality (at the time of addition)"
1013+
"\nDo not use when converting to audio!"
1014+
}
10061015

10071016

10081017
def get_base_settings() -> dict:

0 commit comments

Comments
 (0)