]> gitweb.morketsmerke.org Git - immudex.git/commitdiff
Poprawienie filtrownia wprowadzanej wartości formatu filmów YouTube. main
authorxf0r3m <jakubstasinski@protonmail.com>
Tue, 2 Jun 2026 10:18:53 +0000 (12:18 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Tue, 2 Jun 2026 10:18:53 +0000 (12:18 +0200)
tools/bin/immudex-ytplay

index a1fb8f2b20bd7c8c80eb743b0c14d5d1a791fbea..ef5f2a4761c901241cdad2bb302ad898ac35561d 100755 (executable)
@@ -63,7 +63,7 @@ def ytSearch(keywords, maxResults=15):
 def getFormat(videoID):
   subprocess.run(['yt-dlp', '--list-formats', 'https://youtube.com/watch?v=' + videoID])
   f = input("Please choose youtube video format, you need put video+audio ID of quality in this format or type anything else to quit:")
 def getFormat(videoID):
   subprocess.run(['yt-dlp', '--list-formats', 'https://youtube.com/watch?v=' + videoID])
   f = input("Please choose youtube video format, you need put video+audio ID of quality in this format or type anything else to quit:")
-  if not re.search(r"[0-9]{3}\\+[0-9]{3}|[0-9]{2}", f):
+  if not re.search(r"^[0-9]{3}\+[0-9]{3}$|^[0-9]{2}$", f):
     sys.exit(0)
   else:
     return f 
     sys.exit(0)
   else:
     return f 
@@ -86,7 +86,7 @@ if option == '-s':
   if len(sys.argv) > 2:
     if sys.argv[3] == '-v':
       mode = "video"
   if len(sys.argv) > 2:
     if sys.argv[3] == '-v':
       mode = "video"
-    elif sys.argv[2] == '-a':
+    elif sys.argv[3] == '-a':
       mode = "audio"
     else:
       usage()
       mode = "audio"
     else:
       usage()