Add progress bar

This commit is contained in:
taizan-hokuto
2020-09-03 00:57:26 +09:00
parent e9ed564e1b
commit 4eb18279fe
9 changed files with 168 additions and 112 deletions

View File

@@ -2,7 +2,7 @@ import json
import re
import httpx
from .. import config
from ..exceptions import InvalidVideoIdException
from ..exceptions import InvalidVideoIdException, PatternUnmatchError
from ..util.extract_video_id import extract_video_id
headers = config.headers
@@ -91,6 +91,8 @@ class VideoInfo:
def _parse(self, text):
result = re.search(pattern, text)
if result is None:
raise PatternUnmatchError(text)
res = json.loads(result.group(1)[:-1])
response = self._get_item(res, item_response)
if response is None: