diff --git a/addon/globalPlugins/basic_youtube_downloader/pytube/captions.py b/addon/globalPlugins/basic_youtube_downloader/pytube/captions.py index d63e0d2..fe84bec 100644 --- a/addon/globalPlugins/basic_youtube_downloader/pytube/captions.py +++ b/addon/globalPlugins/basic_youtube_downloader/pytube/captions.py @@ -2,7 +2,7 @@ import os import time import json -from .xml.etree import ElementTree as ElementTree +import xml.etree.ElementTree as ElementTree from html import unescape from typing import Dict, Optional diff --git a/addon/globalPlugins/basic_youtube_downloader/pytube/cipher.py b/addon/globalPlugins/basic_youtube_downloader/pytube/cipher.py index 5b37bad..58ce9dd 100644 --- a/addon/globalPlugins/basic_youtube_downloader/pytube/cipher.py +++ b/addon/globalPlugins/basic_youtube_downloader/pytube/cipher.py @@ -27,7 +27,7 @@ class Cipher: def __init__(self, js: str): self.transform_plan: List[str] = get_transform_plan(js) - var_regex = re.compile(r"^\$*\w+\W") + var_regex = re.compile(r"^\w+\W") var_match = var_regex.search(self.transform_plan[0]) if not var_match: raise RegexMatchError( @@ -269,9 +269,8 @@ def get_throttling_function_name(js: str) -> str: # a.C && (b = a.get("n")) && (b = Bpa[0](b), a.set("n", b), # Bpa.length || iha("")) }}; # In the above case, `iha` is the relevant function name - r'a\.[a-zA-Z]\s*&&\s*\([a-z]\s*=\s*a\.get\("n"\)\)\s*&&\s*' - r'\([a-z]\s*=\s*([a-zA-Z0-9$]+)(\[\d+\])?\([a-z]\)', - ] + r'a\.[a-zA-Z]\s*&&\s*\([a-z]\s*=\s*a\.get\("n"\)\)\s*&&.*?\|\|\s*([a-z]+)', + r'\([a-z]\s*=\s*([a-zA-Z0-9$]+)(\[\d+\])\([a-z]\)', ] logger.debug('Finding throttling function name') for pattern in function_patterns: regex = re.compile(pattern) diff --git a/buildVars.py b/buildVars.py index c1e318f..2b090f7 100644 --- a/buildVars.py +++ b/buildVars.py @@ -25,7 +25,7 @@ def _(arg): # Translators: Long description to be shown for this add-on on add-on information from add-ons manager "addon_description": _("A plugin that can download Youtube videos and playlists."), # version - "addon_version": "2.0.1", + "addon_version": "2.0.2", # Author(s) "addon_author": "Bora FIRLANGEƇ ", # URL for the add-on documentation support