1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

Fix underscore titles #33

This commit is contained in:
Maksym Pavlenko
2019-08-04 22:24:45 -07:00
parent d446760352
commit 54c78adaa3
3 changed files with 15 additions and 6 deletions

View File

@@ -1,2 +1,2 @@
boto3==1.9.129
youtube_dl==2019.06.27
youtube_dl==2019.08.02

View File

@@ -30,6 +30,9 @@ def get_updates(start, count, url, fmt, last_id=None, playlist=None):
if not url:
raise ValueError('Invalid resource URL %s' % url)
if playlist is None:
playlist = []
end = start + count - 1
opts = {

View File

@@ -14,23 +14,29 @@ class TestUpdater(unittest.TestCase):
]
for kind in kinds:
with self.subTest(kind):
feed, items, _ = updater.get_updates(1, 1, TEST_URL, kind)
self.assertIsNotNone(feed)
items, last_id, _ = updater.get_updates(1, 1, TEST_URL, kind)
self.assertIsNotNone(items)
self.assertIsNotNone(last_id)
def test_get_change_list(self):
feed, items, last_id = updater.get_updates(1, 5, TEST_URL, 'worst[ext=mp4]')
items, last_id, _ = updater.get_updates(1, 5, TEST_URL, 'worst[ext=mp4]')
self.assertEqual(len(items), 5)
self.assertEqual(items[0]['ID'], last_id)
test_last_id = items[2]['ID']
self.assertIsNotNone(test_last_id)
feed, items, last_id = updater.get_updates(1, 5, TEST_URL, 'worst[ext=mp4]', test_last_id)
items, last_id, _ = updater.get_updates(1, 5, TEST_URL, 'worst[ext=mp4]', test_last_id)
self.assertEqual(len(items), 2)
self.assertEqual(items[0]['ID'], last_id)
def test_last_id(self):
feed, items, last_id = updater.get_updates(1, 1, TEST_URL, 'worstaudio')
items, last_id, _ = updater.get_updates(1, 1, TEST_URL, 'worstaudio')
self.assertEqual(len(items), 1)
self.assertEqual(items[0]['ID'], last_id)
def test_get_title_issue33(self):
url = 'https://youtube.com/channel/UC9-y-6csu5WGm29I7JiwpnA'
items, _, _ = updater.get_updates(1, 1, url, 'best[ext=mp4]')
for item in items:
self.assertNotEqual('_', item.get('Title'))