Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_create_archive_org_metadata_from_youtubedl_meta_no_date(self):
with open(get_testfile_path(
'Mountain_3_-_Video_Background_HD_1080p-6iRV8liah8A.'
'info_no_date.json')
) as f:
vid_meta = json.load(f)
result = TubeUp.create_archive_org_metadata_from_youtubedl_meta(
vid_meta
)
upload_date = time.strftime("%Y-%m-%d")
upload_year = time.strftime("%Y")
expected_result = {
'mediatype': 'movies',
'creator': 'Video Background',
'collection': 'opensource_movies',
'title': 'Mountain 3 - Video Background HD 1080p',
'description': ('Mountain 3 - Video Background HD 1080p\n'
'If you use this video please put credits to my '
'channel in description:\nhttps://www.youtube.com'
'/channel/UCWpsozCMdAnfI16rZHQ9XDg\n© Don\'t '
'forget to SUBSCRIBE, LIKE, COMMENT and RATE. '
def test_create_archive_org_metadata_from_youtubedl_meta_no_uploader(self):
with open(get_testfile_path(
'Mountain_3_-_Video_Background_HD_1080p-6iRV8liah8A.info_no_'
'uploader.json')
) as f:
vid_meta = json.load(f)
result = TubeUp.create_archive_org_metadata_from_youtubedl_meta(
vid_meta
)
expected_result = {
'mediatype': 'movies',
'creator': 'http://www.youtube.com/channel/UCWpsozCMdAnfI16rZHQ9XDg',
'collection': 'opensource_movies',
'title': 'Mountain 3 - Video Background HD 1080p',
'description': ('Mountain 3 - Video Background HD 1080p\n'
'If you use this video please put credits to my '
'channel in description:\nhttps://www.youtube.com'
'/channel/UCWpsozCMdAnfI16rZHQ9XDg\n© Don\'t '
'forget to SUBSCRIBE, LIKE, COMMENT and RATE. '
'Hope you all enjoy! <br><br>Source: '
'<a href="https://www.youtube.com/watch?v='
'6iRV8liah8A">https://www.youtube.com/watch?v='</a>
def test_create_archive_org_metadata_from_youtubedl_meta(self):
with open(get_testfile_path(
'Mountain_3_-_Video_Background_HD_1080p-6iRV8liah8A.info.json')
) as f:
vid_meta = json.load(f)
result = TubeUp.create_archive_org_metadata_from_youtubedl_meta(
vid_meta
)
expected_result = {
'mediatype': 'movies',
'creator': 'Video Background',
'collection': 'opensource_movies',
'title': 'Mountain 3 - Video Background HD 1080p',
'description': ('Mountain 3 - Video Background HD 1080p\n'
'If you use this video please put credits to my '
'channel in description:\nhttps://www.youtube.com'
'/channel/UCWpsozCMdAnfI16rZHQ9XDg\n© Don\'t '
'forget to SUBSCRIBE, LIKE, COMMENT and RATE. '
'Hope you all enjoy! <br><br>Source: '
'<a href="https://www.youtube.com/watch?v='
'6iRV8liah8A">https://www.youtube.com/watch?v='</a>