Remove retry for testing bilibili

This commit is contained in:
edward.gao 2018-08-10 20:39:25 +08:00
parent d73e50b8f6
commit 170dee568b

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python
import unittest
import urllib
from you_get.extractors import (
imgur,
@ -33,23 +32,12 @@ class YouGetTests(unittest.TestCase):
)
def test_bilibili(self):
maxRetry = 3
# the bilibi is not stable, it got 502 occasionally
for i in range(maxRetry):
try:
bilibili.download(
'https://www.bilibili.com/video/av16907446/', info_only=True
)
bilibili.download(
'https://www.bilibili.com/video/av13228063/', info_only=True
)
return
except urllib.error.HTTPError as e:
if e.error == 502 and i + 1 < maxRetry:
continue
else:
raise e
bilibili.download(
'https://www.bilibili.com/video/av16907446/', info_only=True
)
bilibili.download(
'https://www.bilibili.com/video/av13228063/', info_only=True
)
if __name__ == '__main__':