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

[ie/Hotstar] year added in hotstar metadata #7869

Merged
merged 8 commits into from Aug 31, 2023
Merged

[ie/Hotstar] year added in hotstar metadata #7869

merged 8 commits into from Aug 31, 2023

Conversation

Rajeshwaran2001
Copy link
Contributor

@Rajeshwaran2001 Rajeshwaran2001 commented Aug 16, 2023

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

HotStar Year MetaData Added

Fixes #

Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • 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?

Copilot Summary

🤖 Generated by Copilot at a7d72ea

Summary

✨🎥🇮🇳

Add year metadata field to HotStar extractor. This improves the accuracy and completeness of the video information extracted from the HotStar API.

year field added
from video_data dict
autumn of metadata

Walkthrough

  • Add year field to video metadata from video_data dictionary (link)

@bashonly
Copy link
Member

Please fill out the template checklist or else the PR cannot be accepted:

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • 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?

@pukkandan pukkandan added incomplete Further information is needed pending-fixes PR has had changes requested and removed incomplete Further information is needed labels Aug 20, 2023
@pukkandan
Copy link
Member

And update tests

@@ -283,6 +283,7 @@ def _real_extract(self, url):
return {
'id': video_id,
'title': video_data.get('title'),
'year': video_data.get('year'),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'year': video_data.get('year'),
'release_year': int_or_none(video_data.get('year')),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

suggestion updated and ready to merge

@Rajeshwaran2001
Copy link
Contributor Author

The suggestion for the year has been updated.

@bashonly
Copy link
Member

Update the tests with the release_year

@Rajeshwaran2001
Copy link
Contributor Author

are you talking about unittest? if it is it is done

@bashonly
Copy link
Member

bashonly commented Aug 21, 2023

I am talking about these:

    _TESTS = [{
        'url': 'https://www.hotstar.com/can-you-not-spread-rumours/1000076273',
        'info_dict': {
            'id': '1000076273',
            'ext': 'mp4',
            'title': 'Can You Not Spread Rumours?',
            'description': 'md5:c957d8868e9bc793ccb813691cc4c434',
            'timestamp': 1447248600,
            'upload_date': '20151111',
            'duration': 381,
            'episode': 'Can You Not Spread Rumours?',
        },
        'params': {'skip_download': 'm3u8'},
    }, {
        'url': 'https://www.hotstar.com/tv/ek-bhram-sarvagun-sampanna/s-2116/janhvi-targets-suman/1000234847',
        'info_dict': {
            'id': '1000234847',
            'ext': 'mp4',
            'title': 'Janhvi Targets Suman',
            'description': 'md5:78a85509348910bd1ca31be898c5796b',
            'timestamp': 1556670600,
            'upload_date': '20190501',
            'duration': 1219,
            'channel': 'StarPlus',
            'channel_id': 3,
            'series': 'Ek Bhram - Sarvagun Sampanna',
            'season': 'Chapter 1',
            'season_number': 1,
            'season_id': 6771,
            'episode': 'Janhvi Targets Suman',
            'episode_number': 8,
        }
    }, {

and all the rest

@Rajeshwaran2001
Copy link
Contributor Author

All Done and working fine

@bashonly
Copy link
Member

bashonly commented Aug 21, 2023

All Done and working fine

No, you haven't updated the tests. You need to actually run the tests, and then update them by adding release_year values.

python3 test/test_download.py TestDownload.test_HotStar
python3 test/test_download.py TestDownload.test_HotStar_1
python3 test/test_download.py TestDownload.test_HotStar_2

etc

@bashonly bashonly added the site-enhancement Feature request for some website label Aug 21, 2023
Test 3 Failed due to broken link and fixed with new link
@Rajeshwaran2001
Copy link
Contributor Author

Rajeshwaran2001 commented Aug 22, 2023

Result of Test1: image
Result of Test2:image
Result of Test3:image
Result of Test4:image

Test 3 failed first due to a broken link and I have updated the test with a working link and all tests ok

@bashonly
Copy link
Member

Why do none of the tests return a release_year field, though? The point of adding/updating tests is so we can test that release_year is succesfully extracted

@Rajeshwaran2001
Copy link
Contributor Author

Why do none of the tests return a release_year field, though? The point of adding/updating tests is so we can test that release_year is successfully extracted

release_year is mainly for movies and There is no test for that. You can see release_year extracted for a movie in the info.json file

image.

I can write a new test for this if you want.

@bashonly
Copy link
Member

Yes please do

@Rajeshwaran2001
Copy link
Contributor Author

image

A new test was added and verified

@bashonly bashonly added pending-review PR needs a review and removed pending-fixes PR has had changes requested labels Aug 23, 2023
@Rajeshwaran2001 Rajeshwaran2001 changed the title year added in hotstar metadata [ie/Hotstar] year added in hotstar metadata Aug 24, 2023
@bashonly bashonly removed the pending-review PR needs a review label Aug 27, 2023
@bashonly bashonly merged commit 7237c8d into yt-dlp:master Aug 31, 2023
13 checks passed
@Rajeshwaran2001 Rajeshwaran2001 deleted the orignal branch September 1, 2023 03:24
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Authored by: Rajeshwaran2001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-enhancement Feature request for some website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants