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

[hotstar] Move to API v1 #48

Merged
merged 1 commit into from Sep 6, 2020
Merged

[hotstar] Move to API v1 #48

merged 1 commit into from Sep 6, 2020

Conversation

theincognito-inc
Copy link

@theincognito-inc theincognito-inc commented Sep 5, 2020


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

Description of your pull request and other information

Fixes Hotstar extractor. Tested by me and other community members. Original PR: ytdl-org#25443 . Just did a PR to make things easier for you. As you can see, the original commit is preserved.

@blackjack4494
Copy link
Owner

blackjack4494 commented Sep 6, 2020

related:
ytdl-org#25443

#47
ytdl-org#25003
ytdl-org#24707
ytdl-org#25042

As others seem to have tested it I will merge it.

@theincognito-inc could you post some log output with -v unpatched and patch to show the difference meaning that the patch works?
A new release will come out within next few hours.

@faarish

@blackjack4494 blackjack4494 merged commit 27e248c into blackjack4494:master Sep 6, 2020
@theincognito-inc
Copy link
Author

theincognito-inc commented Sep 6, 2020

@blackjack4494 Sure.

Unpatched:

youtube-dlc -v -F https://www.hotstar.com/in/movies/bangalore-days/1000081352
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-F', 'https://www.hotstar.com/in/movies/bangalore-days/1000081352']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dlc version 2020.09.03.1
[debug] Python version 3.8.5 (CPython) - Windows-10-10.0.19041-SP0
[debug] exe versions: ffmpeg git-2020-06-28-4cfcfb3, ffprobe git-2020-06-28-4cfcfb3
[debug] Proxy map: {}
[hotstar] 1000081352: Downloading webpage
[hotstar] 1000081352: Downloading JSON metadata
[hotstar] 1000081352: Downloading m3u8 information
[info] Available formats for 1000081352:
format code extension resolution note
hls-164 mp4 854x480 164k , avc1.4D401F, mp4a.40.2
hls-201 mp4 426x240 201k , avc1.42C015, mp4a.40.2
hls-212 mp4 1280x720 212k , avc1.640028, mp4a.40.2
hls-223 mp4 640x360 223k , avc1.4D401E, mp4a.40.2
hls-269 mp4 1920x1080 269k , avc1.640028, mp4a.40.2
hls-284 mp4 1920x1080 284k , avc1.640028, mp4a.40.2 (best)

Notice the bitrates. This is because instead of the movie, it will download a stock sample video saying you need to update Hotstar.

Patched:

python -m youtube_dlc -v -F https://www.hotstar.com/in/movies/bangalore-days/1000081352
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-F', 'https://www.hotstar.com/in/movies/bangalore-days/1000081352']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dlc version 2020.09.03.1
[debug] Git HEAD: bc842c2
[debug] Python version 3.8.5 (CPython) - Windows-10-10.0.19041-SP0
[debug] exe versions: ffmpeg git-2020-06-28-4cfcfb3, ffprobe git-2020-06-28-4cfcfb3
[debug] Proxy map: {}
[hotstar] 1000081352: Downloading webpage
[hotstar] 1000081352: Downloading token
[hotstar] 1000081352: Downloading JSON metadata
[hotstar] 1000081352: Downloading m3u8 information
[info] Available formats for 1000081352:
format code extension resolution note
hls-164 mp4 320x180 164k , avc1.42C00C, mp4a.40.5
hls-254 mp4 426x240 254k , avc1.42C015, mp4a.40.5
hls-347 mp4 640x360 347k , avc1.4D401E, mp4a.40.5
hls-433 mp4 854x480 433k , avc1.4D401F, mp4a.40.5
hls-765 mp4 1280x720 765k , avc1.640028, mp4a.40.5
hls-1718 mp4 1920x1080 1718k , avc1.640028, mp4a.40.5 (best)

As you can see, it's now showing expected bitrates, and will download the actual movie.

@vinaykapadia
Copy link

using the latest version, i'm still getting the stock video and the lower bitrates.

D:\ytdl> .\youtube-dlc.exe -v -F https://www.hotstar.com/in/movies/bangalore-days/1000081352
[debug] System config: []
[debug] User config: ['--ffmpeg-location', 'd:\ffmpeg\bin', '--ignore-errors']
[debug] Custom config: []
[debug] Command-line args: ['-v', '-F', 'https://www.hotstar.com/in/movies/bangalore-days/1000081352']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2020.09.14
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: ffmpeg 4.1, ffprobe 4.1
[debug] Proxy map: {}
[hotstar] 1000081352: Downloading webpage
[hotstar] 1000081352: Downloading JSON metadata
[hotstar] 1000081352: Downloading m3u8 information
[info] Available formats for 1000081352:
format code extension resolution note
hls-164 mp4 854x480 164k , avc1.4D401F, mp4a.40.2
hls-201 mp4 426x240 201k , avc1.42C015, mp4a.40.2
hls-212 mp4 1280x720 212k , avc1.640028, mp4a.40.2
hls-223 mp4 640x360 223k , avc1.4D401E, mp4a.40.2
hls-269 mp4 1920x1080 269k , avc1.640028, mp4a.40.2
hls-284 mp4 1920x1080 284k , avc1.640028, mp4a.40.2 (best)

@blackjack4494 blackjack4494 mentioned this pull request Sep 16, 2020
@theincognito-inc
Copy link
Author

theincognito-inc commented Sep 16, 2020

@vinaykapadia It's merged now by @blackjack4494 . It should work fine now.

Btw, please update ffmpeg to v4.3+, to avoid errors.

Just tested:

python -m youtube_dlc -v -F https://www.hotstar.com/in/movies/bangalore-days/1000081352
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-F', 'https://www.hotstar.com/in/movies/bangalore-days/1000081352']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dlc version 2020.09.16
[debug] Git HEAD: fe84e2a
[debug] Python version 3.8.5 (CPython) - Windows-10-10.0.19041-SP0
[debug] exe versions: ffmpeg git-2020-08-31-4a11a6f, ffprobe git-2020-08-31-4a11a6f
[debug] Proxy map: {}
[hotstar] 1000081352: Downloading webpage
[hotstar] 1000081352: Downloading token
[hotstar] 1000081352: Downloading JSON metadata
[hotstar] 1000081352: Downloading m3u8 information
[info] Available formats for 1000081352:
format code extension resolution note
hls-164 mp4 320x180 164k , avc1.42C00C, mp4a.40.5
hls-254 mp4 426x240 254k , avc1.42C015, mp4a.40.5
hls-347 mp4 640x360 347k , avc1.4D401E, mp4a.40.5
hls-433 mp4 854x480 433k , avc1.4D401F, mp4a.40.5
hls-765 mp4 1280x720 765k , avc1.640028, mp4a.40.5
hls-1718 mp4 1920x1080 1718k , avc1.640028, mp4a.40.5 (best)

@vinaykapadia
Copy link

Thanks, will try that.

@vinaykapadia
Copy link

Does it take some time to show the update? youtube-dlc.exe -U is saying 2020.09.14 is up to date.

@theincognito-inc
Copy link
Author

@vinaykapadia I don't know. I don't use the exe. Maybe the updater is broken? If you are using the exe, just grab the latest exe from the releases tab. https://github.com/blackjack4494/youtube-dlc/releases/download/2020.09.16/youtube-dlc.exe

@vinaykapadia
Copy link

Thanks. Still having issues.

With VPN to India:

.\youtube-dlc.exe -v -F https://www.hotstar.com/in/movies/bangalore-days/1000081352
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-F', 'https://www.hotstar.com/in/movies/bangalore-days/1000081352']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dlc version 2020.09.16
[debug] Python version 3.8.5 (CPython) - Windows-10-10.0.19041-SP0
[debug] exe versions: none
[debug] Proxy map: {}
[hotstar] 1000081352: Downloading webpage
[hotstar] 1000081352: Downloading token
[hotstar] 1000081352: Downloading JSON metadata
[hotstar] 1000081352: Downloading m3u8 information
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dlc -U  to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "youtube_dlc\YoutubeDL.py", line 798, in extract_info
  File "youtube_dlc\extractor\common.py", line 530, in extract
  File "youtube_dlc\extractor\hotstar.py", line 169, in _real_extract
  File "youtube_dlc\extractor\common.py", line 1350, in _sort_formats
youtube_dlc.utils.ExtractorError: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dlc -U  to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.

Without VPN (United States):

.\youtube-dlc.exe -v -F https://www.hotstar.com/in/movies/bangalore-days/1000081352
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-F', 'https://www.hotstar.com/in/movies/bangalore-days/1000081352']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dlc version 2020.09.16
[debug] Python version 3.8.5 (CPython) - Windows-10-10.0.19041-SP0
[debug] exe versions: none
[debug] Proxy map: {}
[hotstar] 1000081352: Downloading webpage
[hotstar] 1000081352: Downloading token
[hotstar] 1000081352: Downloading JSON metadata
ERROR: Unable to download JSON metadata: HTTP Error 400: Bad Request (caused by <HTTPError 400: 'Bad Request'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dlc -U  to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.
  File "youtube_dlc\extractor\common.py", line 627, in _request_webpage
  File "youtube_dlc\YoutubeDL.py", line 2278, in urlopen
  File "urllib\request.py", line 531, in open
  File "urllib\request.py", line 640, in http_response
  File "urllib\request.py", line 569, in error
  File "urllib\request.py", line 502, in _call_chain
  File "urllib\request.py", line 649, in http_error_default

@blackjack4494
Copy link
Owner

blackjack4494 commented Sep 17, 2020

@vinaykapadia

I used N0RD vpn. Connected to India (Country) Server was #77.
I then tried to play the video in the browser. That didn't work.
But this did

PS D:\gitkraken\youtube-dl> youtube-dlc "https://www.hotstar.com/in/movies/bangalore-days/1000081352" -v -F
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.hotstar.com/in/movies/bangalore-days/1000081352', '-v', '-F']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dlc version 2020.09.16
[debug] Python version 3.6.5 (CPython) - Windows-10-10.0.19041-SP0
[debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1
[debug] Proxy map: {}
[hotstar] 1000081352: Downloading webpage
[hotstar] 1000081352: Downloading token
[hotstar] 1000081352: Downloading JSON metadata
[hotstar] 1000081352: Downloading m3u8 information
[info] Available formats for 1000081352:
format code extension resolution note
hls-164 mp4 320x180 164k , avc1.42C00C, mp4a.40.5
hls-254 mp4 426x240 254k , avc1.42C015, mp4a.40.5
hls-347 mp4 640x360 347k , avc1.4D401E, mp4a.40.5
hls-433 mp4 854x480 433k , avc1.4D401F, mp4a.40.5
hls-765 mp4 1280x720 765k , avc1.640028, mp4a.40.5
hls-1718 mp4 1920x1080 1718k , avc1.640028, mp4a.40.5 (best)

So I assume you just picked a faulty vpn which was blocked or so.
Downloading also works

PS D:\gitkraken\youtube-dl> youtube-dlc "https://www.hotstar.com/in/movies/bangalore-days/1000081352"
[hotstar] 1000081352: Downloading webpage
[hotstar] 1000081352: Downloading token
[hotstar] 1000081352: Downloading JSON metadata
[hotstar] 1000081352: Downloading m3u8 information
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 2464
[download] Destination: Bangalore Days-1000081352.mp4
[download] 0.3% of ~1.38GiB at 440.89KiB/s ETA 02:57:51

@vinaykapadia
Copy link

@blackjack4494 i'm also using Nord. I'll try with server #77.

@vinaykapadia
Copy link

It worked, thanks!

@sumit-1988
Copy link

Is it working ?

@vinaykapadia
Copy link

@sumit-1988 Yes.

@blackjack4494
Copy link
Owner

@sumit-1988 and @vinaykapadia did you try the latest version?

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.

None yet

4 participants