Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[americastestkitchen] Fix metadata extraction for ATK episodes #27860

Merged
merged 3 commits into from
Jan 18, 2021

Conversation

bm1549
Copy link
Contributor

@bm1549 bm1549 commented Jan 18, 2021

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

Explanation of your pull request in arbitrary form goes here. Please make sure the description explains the purpose and effect of your pull request and is worded well enough to be understood. Provide as much context and examples as possible.

Although the API does not appear to have changed between episode 582 and episode 705, the existing code fails to extract the metadata correctly for episode 705. This PR updates the metadata extraction to work well with the ATK api.

@bm1549
Copy link
Contributor Author

bm1549 commented Jan 18, 2021

FYI @remitamine this may be related to 17b0122

'release_date': unified_strdate(video.get('publishDate')),
'upload_date': unified_strdate(video.get('publishDate')),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line(will be calculated automatically from timestamp).

@@ -33,6 +34,25 @@ class AmericasTestKitchenIE(InfoExtractor):
'params': {
'skip_download': True,
},
}, {
'url': 'https://www.americastestkitchen.com/episode/705-simple-chicken-dinner',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment on why this test has been added.

Comment on lines 86 to 87
'episode_number': episode.get('number'),
'season_number': episode.get('season'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use int_or_none.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for episode_number(both lines where highlighted).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake. Just fixed this!

@@ -80,11 +83,10 @@ def _real_extract(self, url):
'url': 'https://player.zype.com/embed/%s.js?api_key=jZ9GUhRmxcPvX7M3SlfejB6Hle9jyHTdk2jVxG7wOHPLODgncEKVdPYBhuz9iWXQ' % video['zypeId'],
'ie_key': 'Zype',
'description': clean_html(video.get('description')),
'timestamp': parse_iso8601(video.get('publishDate')),
'timestamp': unified_timestamp(video.get('publishDate')),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timestamp was not a valid iso8601 timestamp. This fixes that issue and the timestamp in the second test case proves it

@bm1549 bm1549 changed the title Fix metadata extraction for ATK episodes [americastestkitchen] Fix metadata extraction for ATK episodes Jan 18, 2021
@remitamine remitamine merged commit f9201ce into ytdl-org:master Jan 18, 2021
@bm1549 bm1549 deleted the add-atk-metadata branch January 18, 2021 15:35
ThirumalaiK pushed a commit to ThirumalaiK/youtube-dl that referenced this pull request Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants