refactor: update query handling in Node class

This commit is contained in:
cloudwithax 2024-06-10 21:17:53 -04:00
parent b3795102b8
commit ad01407fff
2 changed files with 3 additions and 7 deletions

View File

@ -14,7 +14,7 @@ repos:
rev: 23.10.1 rev: 23.10.1
hooks: hooks:
- id: black - id: black
language_version: python3.11 language_version: python3.12
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v3.15.0 rev: v3.15.0
hooks: hooks:
@ -28,10 +28,6 @@ repos:
rev: v3.1.0 rev: v3.1.0
hooks: hooks:
- id: add-trailing-comma - id: add-trailing-comma
- repo: https://github.com/hadialqattan/pycln
rev: v2.3.0
hooks:
- id: pycln
default_language_version: default_language_version:
python: python3.11 python: python3.12

View File

@ -704,7 +704,7 @@ class Node:
) )
else: else:
if not URLRegex.BASE_URL.match(query) and not re.match(r"(?:ytm?|sc)search:.", query): if not URLRegex.BASE_URL.match(query) and not re.match(r"(?:[a-z]+?)search:.", query):
query = f"{search_type}:{query}" query = f"{search_type}:{query}"
# If YouTube url contains a timestamp, capture it for use later. # If YouTube url contains a timestamp, capture it for use later.