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

[Extractor Error] Getting extractor error when downloading videos from VIU. #26788

Open
AlecHex opened this issue Oct 3, 2020 · 91 comments · May be fixed by #26775
Open

[Extractor Error] Getting extractor error when downloading videos from VIU. #26788

AlecHex opened this issue Oct 3, 2020 · 91 comments · May be fixed by #26775

Comments

@AlecHex
Copy link

@AlecHex AlecHex commented Oct 3, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.09.20
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.viu.com/ott/sg/en-us/vod/13733/Coffee-Prince', '--verbose']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2020.09.20
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: ffmpeg 4.3.1-essentials_build-www.gyan.dev, ffprobe git-2019-12-08-9f7b2b3
[debug] Proxy map: {}
[viu:ott] 13733: Downloading video info
[viu:ott] 13733: Downloading stream info
ERROR: An extractor error has occurred. (caused by KeyError('data',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\extractor\common.py", line 532, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\extractor\viu.py", line 233, in _real_extract
KeyError: 'data'
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\extractor\common.py", line 532, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\extractor\viu.py", line 233, in _real_extract
KeyError: 'data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\YoutubeDL.py", line 797, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\extractor\common.py", line 545, in extract
youtube_dl.utils.ExtractorError: An extractor error has occurred. (caused by KeyError('data',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description

This doesn't require any credentials so it is easy to duplicate. I am running Windows 10 and youtube-dl.exe and have begun seeing this error for about 1 week now. I am unsure as to myself doing anything wrong as I am doing the same as I did earlier when it used to work. Any help regarding this issue will be really great.

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 3, 2020

There's already a fixed for that. But the source code is not yet compiled.

Check this
#26775
#26723
#26701

@AlecHex
Copy link
Author

@AlecHex AlecHex commented Oct 3, 2020

There's already a fixed for that. But the source code is not yet compiled.

Check this
#26775
#26723
#26701

Thank you for responding, I was unable to find the threads, is there any ETA for the next update, that may fix this?

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

There's already a fixed for that. But the source code is not yet compiled.
Check this
#26775
#26723
#26701

Thank you for responding, I was unable to find the threads, is there any ETA for the next update, that may fix this?

I don't know. This is not their priorities.

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

Well, you could try this for now.

Make sure you have python installed on your sytem.

  1. Download the latest source code
    https://github.com/ytdl-org/youtube-dl/releases/download/2020.09.20/youtube-dl

and then
2. Save this as viu.py (or ask @lkho for his updated code)
https://raw.githubusercontent.com/ytdl-org/youtube-dl/1e0f4c34608c7f5815e3833bf2bcf33cb50c9a7f/youtube_dl/extractor/viu.py

3 Now go to extractor folder from the souce code "C:\bin\youtube-dl-2020.09.06\youtube_dl\extractor" and replace with the updated codes you saved.

  1. Inside this folder: C:\bin\youtube-dl-2020.09.06\youtube_dl
    open your cmd and then paste this to go to that dir.

cd C:\bin\youtube-dl-2020.09.06\youtube_dl

  1. Now paste this command on your cmd.
    python __main__.py https://www.viu.com/ott/sg/en-us/vod/13733/Coffee-Prince
@zackmark29 zackmark29 mentioned this issue Oct 4, 2020
5 of 5 tasks complete
@touchhyuk
Copy link

@touchhyuk touchhyuk commented Oct 4, 2020

Well, you could try this for now.

Make sure you have python installed on your sytem.

  1. Download the latest source code
    https://github.com/ytdl-org/youtube-dl/releases/download/2020.09.20/youtube-dl

and then
2. Save this as viu.py (or ask @lkho for his updated code)
https://raw.githubusercontent.com/ytdl-org/youtube-dl/1e0f4c34608c7f5815e3833bf2bcf33cb50c9a7f/youtube_dl/extractor/viu.py

3 Now go to extractor folder from the souce code "C:\bin\youtube-dl-2020.09.06\youtube_dl\extractor" and replace with the updated codes you saved.

  1. Inside this folder: C:\bin\youtube-dl-2020.09.06\youtube_dl
    open your cmd and then paste this to go to that dir.

cd C:\bin\youtube-dl-2020.09.06\youtube_dl

  1. Now paste this command on your cmd.
    python __main__.py https://www.viu.com/ott/sg/en-us/vod/13733/Coffee-Prince

thank you. it's work but not working for premium videos like this. https://www.viu.com/ott/sg/en-us/vod/299246/Do-You-Like-Brahms

how can i download this link?

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

Well, you could try this for now.
Make sure you have python installed on your sytem.

  1. Download the latest source code
    https://github.com/ytdl-org/youtube-dl/releases/download/2020.09.20/youtube-dl

and then
2. Save this as viu.py (or ask @lkho for his updated code)
https://raw.githubusercontent.com/ytdl-org/youtube-dl/1e0f4c34608c7f5815e3833bf2bcf33cb50c9a7f/youtube_dl/extractor/viu.py
3 Now go to extractor folder from the souce code "C:\bin\youtube-dl-2020.09.06\youtube_dl\extractor" and replace with the updated codes you saved.

  1. Inside this folder: C:\bin\youtube-dl-2020.09.06\youtube_dl
    open your cmd and then paste this to go to that dir.

cd C:\bin\youtube-dl-2020.09.06\youtube_dl

  1. Now paste this command on your cmd.
    python __main__.py https://www.viu.com/ott/sg/en-us/vod/13733/Coffee-Prince

thank you. it's work but not working for premium videos like this. https://www.viu.com/ott/sg/en-us/vod/299246/Do-You-Like-Brahms

how can i download this link?

That's the changes from Viu. You'll need now premium token. On my personal tool that's what I did.
They're not yet added the premium future.

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

I tried it now in my personal tool and I get the streams. but you'll need premium account.
Like in this screenshot, the first result, the streams/m3u8 is NOT FOUND and then when I used premium account and get the cookies, I can gett the streams.
image

Here's what I've noticed @lkho @panda130

For SG url, sometimes you'll need to play first in your browser before trying to use youtube-dl. I don't know why, maybe it's required another cookies.

And in that can case, the ccs api, must include identity into query to get the premium videos correctly.
like this. https://d1k2us671qcoau.cloudfront.net/distribute_web_sg.php?ccs_product_id=49fc785360f200de94d202e94b458c29&language_flag_id=3&identity=6855251b4b6fadafd26107dd05a2ca3761fe60b4

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

@lkho @panda130
Here's the demonstration for sg fix.
watch:
https://www.youtube.com/watch?v=j8kJQeOR1P8

@touchhyuk
Copy link

@touchhyuk touchhyuk commented Oct 4, 2020

I tried it now in my personal tool and I get the streams. but you'll need premium account.
Like in this screenshot, the first result, the streams/m3u8 is NOT FOUND and then when I used premium account and get the cookies, I can gett the streams.
image

Here's what I've noticed @lkho @panda130

For SG url, sometimes you'll need to play first in your browser before trying to use youtube-dl. I don't know why, maybe it's required another cookies.

And in that can case, the ccs api, must include identity into query to get the premium videos correctly.
like this. https://d1k2us671qcoau.cloudfront.net/distribute_web_sg.php?ccs_product_id=49fc785360f200de94d202e94b458c29&language_flag_id=3&identity=6855251b4b6fadafd26107dd05a2ca3761fe60b4

i havent tool. what do i do? after get premium account how can i download like you?

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

I tried it now in my personal tool and I get the streams. but you'll need premium account.
Like in this screenshot, the first result, the streams/m3u8 is NOT FOUND and then when I used premium account and get the cookies, I can gett the streams.
image
Here's what I've noticed @lkho @panda130
For SG url, sometimes you'll need to play first in your browser before trying to use youtube-dl. I don't know why, maybe it's required another cookies.
And in that can case, the ccs api, must include identity into query to get the premium videos correctly.
like this. https://d1k2us671qcoau.cloudfront.net/distribute_web_sg.php?ccs_product_id=49fc785360f200de94d202e94b458c29&language_flag_id=3&identity=6855251b4b6fadafd26107dd05a2ca3761fe60b4

i havent tool. what do i do? after get premium account how can i download like you?

Just wait for @lkho or @panda130 to edit the viu to add the identity query.

@touchhyuk
Copy link

@touchhyuk touchhyuk commented Oct 4, 2020

I tried it now in my personal tool and I get the streams. but you'll need premium account.
Like in this screenshot, the first result, the streams/m3u8 is NOT FOUND and then when I used premium account and get the cookies, I can gett the streams.
image
Here's what I've noticed @lkho @panda130
For SG url, sometimes you'll need to play first in your browser before trying to use youtube-dl. I don't know why, maybe it's required another cookies.
And in that can case, the ccs api, must include identity into query to get the premium videos correctly.
like this. https://d1k2us671qcoau.cloudfront.net/distribute_web_sg.php?ccs_product_id=49fc785360f200de94d202e94b458c29&language_flag_id=3&identity=6855251b4b6fadafd26107dd05a2ca3761fe60b4

i havent tool. what do i do? after get premium account how can i download like you?

Just wait for @lkho or @panda130 to edit the viu to add the identity query.

ok. i wait for them to send here

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

Also I've noticed, when I changed the country code to PH. even the url is SG,
I can get the streams without using vpn.

URL: https://www.viu.com/ott/sg/en-us/vod/299246/Do-You-Like-Brahms
CountryCode = 5;
LanguageFlagId = 3;
ut = 0;

API:
CCS https://d1k2us671qcoau.cloudfront.net/distribute_web_ph.php?ccs_product_id=49fc785360f200de94d202e94b458c29&language_flag_id=3&identity=8dda66eaa5af83badd40a509cf05af92b5009b76
AJAX https://www.viu.com/ott/ph/index.php?r=vod/ajax-detail&platform_flag_label=web&area_id=5&language_flag_id=3&product_id=299244&ut=0

Maybe that's the other way you can access the premium videos from your country. Because here's in PH. that given url is not premium that's why I can easily get the streams.

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

@touchhyuk could you try use hola vpn on chrome and change the country to PH?
and just check if your url is also premium. If not, you have a chance to get the streams without premium account

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

Also I've noticed, when I changed the country code to PH. even the url is SG,
I can get the streams without using vpn.
URL: https://www.viu.com/ott/sg/en-us/vod/299246/Do-You-Like-Brahms
CountryCode = 5;
LanguageFlagId = 3;
ut = 0;
API:
CCS https://d1k2us671qcoau.cloudfront.net/distribute_web_ph.php?ccs_product_id=49fc785360f200de94d202e94b458c29&language_flag_id=3&identity=8dda66eaa5af83badd40a509cf05af92b5009b76
AJAX https://www.viu.com/ott/ph/index.php?r=vod/ajax-detail&platform_flag_label=web&area_id=5&language_flag_id=3&product_id=299244&ut=0
Maybe that's the other way you can access the premium videos from your country. Because here's in PH. that given url is not premium that's why I can easily get the streams.

where input this code? API:
CCS https://d1k2us671qcoau.cloudfront.net/distribute_web_ph.php?ccs_product_id=49fc785360f200de94d202e94b458c29&language_flag_id=3&identity=8dda66eaa5af83badd40a509cf05af92b5009b76
AJAX https://www.viu.com/ott/ph/index.php?r=vod/ajax-detail&platform_flag_label=web&area_id=5&language_flag_id=3&product_id=299244&ut=0

i can connect ph with express vpn

they must update that API from the source code.

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

well, for now just give me the url you want to download and I'll give you the m3u8 url and then you can download it via youtube-dl

@touchhyuk
Copy link

@touchhyuk touchhyuk commented Oct 4, 2020

well, for now just give me the url you want to download and I'll give you the m3u8 url and then you can download it via youtube-dl

https://www.viu.com/ott/sg/en-us/vod/300009/Lie-After-Lie

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

well, for now just give me the url you want to download and I'll give you the m3u8 url and then you can download it via youtube-dl

https://www.viu.com/ott/sg/en-us/vod/300009/Lie-After-Lie

Here. (I used SG API with premium account)
https://d1k2us671qcoau.cloudfront.net/vodapi/viu_akm.m3u8?vid=c3f3b6132bd78fbaa293d94e61dd6fc8&layer=Layer4&ts=202010042137&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMWsydXM2NzFxY29hdS5jbG91ZGZyb250Lm5ldC92b2RhcGkvKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTYwMTgzMzA1Mn19fV19&Signature=Ui9hBFtBLX-QORfZk1IKD~9clt7-ZlhN7I4mu89IDFpxXdB2iWQ2Y3PlOVo4AIhSYB-p40TSmmqM1hcLdQY7yceuR4YbhTnXsL7~yPBb28xBegQk5OESYmv73esqUcc6hR0V7ggFtaDleM2a9r52YAcS8IEqFmOjyPNlvW2k6R6gXMw4~V1F2v54JtCHFTbBDBPJ2N7r6zv1~~4VTy6A-WfFp97woWr0OBqDUFJeuKBAcmf1p9NeJ6WuJe2dgNblbyLmIRPMDqbhWh0b4qh4lJd344qGa9QTSFFJWyOfvsh3CW7ZDPJjCRictTnUP7xwZb9Dq1svgBOuAH6YEmvl7Q__&Key-Pair-Id=APKAJ6Z4RF5IYK7Y3SQQ

how can i use this?

here:

youtube-dl --hls-prefer-native --output "OUTPUT FILENAME.mp4" "https://d1k2us671qcoau.cloudfront.net/vodapi/viu_akm.m3u8?vid=c3f3b6132bd78fbaa293d94e61dd6fc8&layer=Layer4&ts=202010042137&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMWsydXM2NzFxY29hdS5jbG91ZGZyb250Lm5ldC92b2RhcGkvKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTYwMTgzMzA1Mn19fV19&Signature=Ui9hBFtBLX-QORfZk1IKD~9clt7-ZlhN7I4mu89IDFpxXdB2iWQ2Y3PlOVo4AIhSYB-p40TSmmqM1hcLdQY7yceuR4YbhTnXsL7~yPBb28xBegQk5OESYmv73esqUcc6hR0V7ggFtaDleM2a9r52YAcS8IEqFmOjyPNlvW2k6R6gXMw4~V1F2v54JtCHFTbBDBPJ2N7r6zv1~~4VTy6A-WfFp97woWr0OBqDUFJeuKBAcmf1p9NeJ6WuJe2dgNblbyLmIRPMDqbhWh0b4qh4lJd344qGa9QTSFFJWyOfvsh3CW7ZDPJjCRictTnUP7xwZb9Dq1svgBOuAH6YEmvl7Q__&Key-Pair-Id=APKAJ6Z4RF5IYK7Y3SQQ"

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

It's already 1080p so you don't need to specify the resolution

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

or you can change to --hls-prefer--ffmpeg

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

You can add also this commands:
--hls-use-mpegts
--fixup warn
--no-part

you can previe while downloading

@touchhyuk
Copy link

@touchhyuk touchhyuk commented Oct 4, 2020

well, for now just give me the url you want to download and I'll give you the m3u8 url and then you can download it via youtube-dl

https://www.viu.com/ott/sg/en-us/vod/300009/Lie-After-Lie

Here. (I used SG API with premium account)
https://d1k2us671qcoau.cloudfront.net/vodapi/viu_akm.m3u8?vid=c3f3b6132bd78fbaa293d94e61dd6fc8&layer=Layer4&ts=202010042137&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMWsydXM2NzFxY29hdS5jbG91ZGZyb250Lm5ldC92b2RhcGkvKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTYwMTgzMzA1Mn19fV19&Signature=Ui9hBFtBLX-QORfZk1IKD~9clt7-ZlhN7I4mu89IDFpxXdB2iWQ2Y3PlOVo4AIhSYB-p40TSmmqM1hcLdQY7yceuR4YbhTnXsL7~yPBb28xBegQk5OESYmv73esqUcc6hR0V7ggFtaDleM2a9r52YAcS8IEqFmOjyPNlvW2k6R6gXMw4~V1F2v54JtCHFTbBDBPJ2N7r6zv1~~4VTy6A-WfFp97woWr0OBqDUFJeuKBAcmf1p9NeJ6WuJe2dgNblbyLmIRPMDqbhWh0b4qh4lJd344qGa9QTSFFJWyOfvsh3CW7ZDPJjCRictTnUP7xwZb9Dq1svgBOuAH6YEmvl7Q__&Key-Pair-Id=APKAJ6Z4RF5IYK7Y3SQQ

how can i use this?

here:

youtube-dl --hls-prefer-native --output "OUTPUT FILENAME.mp4" "https://d1k2us671qcoau.cloudfront.net/vodapi/viu_akm.m3u8?vid=c3f3b6132bd78fbaa293d94e61dd6fc8&layer=Layer4&ts=202010042137&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMWsydXM2NzFxY29hdS5jbG91ZGZyb250Lm5ldC92b2RhcGkvKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTYwMTgzMzA1Mn19fV19&Signature=Ui9hBFtBLX-QORfZk1IKD~9clt7-ZlhN7I4mu89IDFpxXdB2iWQ2Y3PlOVo4AIhSYB-p40TSmmqM1hcLdQY7yceuR4YbhTnXsL7~yPBb28xBegQk5OESYmv73esqUcc6hR0V7ggFtaDleM2a9r52YAcS8IEqFmOjyPNlvW2k6R6gXMw4~V1F2v54JtCHFTbBDBPJ2N7r6zv1~~4VTy6A-WfFp97woWr0OBqDUFJeuKBAcmf1p9NeJ6WuJe2dgNblbyLmIRPMDqbhWh0b4qh4lJd344qGa9QTSFFJWyOfvsh3CW7ZDPJjCRictTnUP7xwZb9Dq1svgBOuAH6YEmvl7Q__&Key-Pair-Id=APKAJ6Z4RF5IYK7Y3SQQ"

thank you. it's work fine
how can i get api link with premiunm account?

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

n i get api link with premiunm account?

Just wait until they update the source code. If I'm just good at python I can compile it for you.
But I only know C#

@touchhyuk
Copy link

@touchhyuk touchhyuk commented Oct 4, 2020

n i get api link with premiunm account?

Just wait until they update the source code. If I'm just good at python I can compile it for you.
But I only know C#

will need premium account after update source code?

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 4, 2020

n i get api link with premiunm account?

Just wait until they update the source code. If I'm just good at python I can compile it for you.
But I only know C#

will need premium account after update source code?

Yeah. but it's only required for the premium vidoes

@touchhyuk
Copy link

@touchhyuk touchhyuk commented Oct 4, 2020

n i get api link with premiunm account?

Just wait until they update the source code. If I'm just good at python I can compile it for you.
But I only know C#

please teach me how get m3u8
i dont know when they update source code

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 5, 2020

n i get api link with premiunm account?

Just wait until they update the source code. If I'm just good at python I can compile it for you.
But I only know C#

please teach me how get m3u8
i dont know when they update source code

Alright. here's the chrome extension that I modified. This is what I'm using before
The video tutorial is included. https://www.upload.ee/files/12352350/cat-catch-1.0.12__Moded_by_zackmark29_.rar.html

@lkho
Copy link
Contributor

@lkho lkho commented Oct 11, 2020

@zackmark29 @panda130 from my observations:

ut query param is user_level, retrieved from GET /ott/<area>/index.php?r=user/info response: data.user.user_level

  • when anonymous, data is null
  • when logged in, data.user.user_level is integer > 0
  • this user_level field is also referenced in GET /ott/sg/index.php?r=vod/ajax-detail&product_id=<id>&ut=<user_level> response: data.current_product.user_level
    • for non-premium videos, data.current_product.user_level is 0, for premium videos, it is > 0
@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

@zackmark29 @panda130 from my observations:

ut query param is user_level, retrieved from GET /ott/<area>/index.php?r=user/info response: data.user.user_level

  • when anonymous, data is null

  • when logged in, data.user.user_level is integer > 0

  • this user_level field is also referenced in GET /ott/sg/index.php?r=vod/ajax-detail&product_id=<id>&ut=<user_level> response: data.current_product.user_level

    • for non-premium videos, data.current_product.user_level is 0, for premium videos, it is > 0

Oh I see. thanks for that.

By the way, In my case. I don't think so if I still needed to login to get the token because I just found another way to download the premium videos with the preview but I just tried for ph url only.
I get the final m3u8 url and then replace the duration=180 from the url with duration=2000. and I get the original m3u8.

I thought the preview is only a trailer but still it's only have the limited duration.

edit: I tried also for SG url without logging in and it worked by replacing duration from m3u8 url. But still needed to play first the video from url (for sg url only)

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

By the way. I accidentally logout the account. You may login again

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

something like this

		bool IsPreview = false;
		string ccs_api = "https://d1k2us671qcoau.cloudfront.net/distribute_web_{COUNTRY_CODE}.php?ccs_product_id={ccs_product_id}&language_flag_id={LANG_FLAG}";
		var duration_param = "&duration=180&duration_start=0";
bypass: var api_ccs = IsPreview ? ccs_api + duration_param : ccs_api;
		using (var doc = await ApiClient.ParseJson(api_ccs, HttpMethod.Get, cts).ConfigureAwait(false)) {
			var elem = doc.RootElement;
			var message = elem.Get("status")?.Get("message")?.GetString();

			if (message == "Access violated") { 
			IsPreview = true; goto bypass; }
@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

@lkho
i found the another solution for the sg url. we don't have now needed to play from the browser first.
We can add the headers : request.Headers.Add("X-Forwarded-For", "52.74.55.164");

@lkho
Copy link
Contributor

@lkho lkho commented Oct 11, 2020

I get the final m3u8 url and then replace the duration=180 from the url with duration=2000. and I get the original m3u8.

this is what I did yesterday. but I think they will eventually block this also. so we better add the identity token properly to support premium videos. as previously I found that there are some videos that don't even allow previews.

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

I get the final m3u8 url and then replace the duration=180 from the url with duration=2000. and I get the original m3u8.

this is what I did yesterday. but I think they will eventually block this also. so we better add the identity token properly to support premium videos. as previously I found that there are some videos that don't even allow previews.

Yeah. I just did not remove the option to login just in case there will be an error.

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

I get the final m3u8 url and then replace the duration=180 from the url with duration=2000. and I get the original m3u8.

this is what I did yesterday. but I think they will eventually block this also. so we better add the identity token properly to support premium videos. as previously I found that there are some videos that don't even allow previews.

Do you still have the history from your browser the url that doesn't have previews? I'd like to see

@lkho
Copy link
Contributor

@lkho lkho commented Oct 11, 2020

Do you still have the history from your browser the url that doesn't have previews? I'd like to see

I can't find it currently, maybe they fixed the bug after I tried many times last week :P
#26788 (comment)

@lkho
Copy link
Contributor

@lkho lkho commented Oct 11, 2020

ok I've finished the login function.
@zackmark29 @touchhyuk you can try this branch
https://github.com/lkho/youtube-dl/tree/pr/viuott

$ youtube-dl <url> --username <email> --password <password>
or
$ youtube-dl <url> --netrc (see https://github.com/ytdl-org/youtube-dl#authentication-with-netrc-file)

however, @zackmark29 I can't reproduce the "needed to play from the browser first" scenario. I have always succeeded regardless of playing in browser or not.

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

ok I've finished the login function.
@zackmark29 @touchhyuk you can try this branch
https://github.com/lkho/youtube-dl/tree/pr/viuott

however, @zackmark29 I can't reproduce the "needed to play from the browser first" scenario. I have always succeeded regardless of playing in browser or not.

Oh nice!

Yeah maybe in your country it doesn't needed.
I think only with PH country. but I resolved it already without playing first by adding the header X-Forward-For

By the way, I just see that you also have a PR for the changing the duration.
We can also get the exact duration by getting the from ['data']['current_product']['time_duration']

@lkho
Copy link
Contributor

@lkho lkho commented Oct 11, 2020

@zackmark29 i tested in both HK and SG, can't reproduce.

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

@zackmark29 i tested in both HK and SG, can't reproduce.

can you provide the url I'll just gonna test

@lkho
Copy link
Contributor

@lkho lkho commented Oct 11, 2020

i tested with many of the premium videos i can found on the website (SG), all can download successfully

https://lkho.me/dl/private/github_oq8nm40fpz9al/2020-10-12%2000-45-19.mp4

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

i tested with many of the premium videos i can found on the website (SG), all can download successfully

https://lkho.me/dl/private/github_oq8nm40fpz9al/2020-10-12%2000-45-19.mp4

Yeah I think only in PH that needed to play first in the browser (but this is not a problem anymore. I already fixed)

In your video, did you still add the bypass for the duration?

@lkho
Copy link
Contributor

@lkho lkho commented Oct 11, 2020

In your video, did you still add the bypass for the duration?

yes. that's why i need not to login ... 😂

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

In your video, did you still add the bypass for the duration?

yes.

Ah alright. so we already fixed everything.

Yeah me too. I don't need to login anymore haha hopefully the bypass will always work.
I just done checking many premium videos but all of them have a preview.

@lkho
Copy link
Contributor

@lkho lkho commented Oct 11, 2020

this is how it looks like if I don't use the duration hack:
https://lkho.me/dl/private/github_oq8nm40fpz9al/2020-10-12%2001-24-17.mp4

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

this is how it looks like if I don't use the duration hack:
https://lkho.me/dl/private/github_oq8nm40fpz9al/2020-10-12%2001-24-17.mp4

what does --netrc?

@lkho
Copy link
Contributor

@lkho lkho commented Oct 11, 2020

because i don't want to show the credentials on screen, so i put it in a separate file. it's just the same as putting it in the command args.
see https://github.com/ytdl-org/youtube-dl#authentication-with-netrc-file

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

because i don't want to show the credentials on screen, so i put it in a separate file. it's just the same as putting it in the command args.
see https://github.com/ytdl-org/youtube-dl#authentication-with-netrc-file

haha ah Ok. by the way. you can keep the credential that I included in the project file.
I have a back up accounts

@lkho
Copy link
Contributor

@lkho lkho commented Oct 11, 2020

The credentials will only work in that specific country, for me it is no use if I use it in HK 😂. unless you will always VPN to SG first when visiting viu.com.

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 11, 2020

The credentials will only work in that specific country, for me it is no use if I use it in HK 😂. unless you will always VPN to SG first when visiting viu.com.

Yeah only works for SG. it's only useful for your for testing purpose =D

@AlecHex
Copy link
Author

@AlecHex AlecHex commented Oct 12, 2020

I am still so out of the loop. Damn sorry y'all

@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 12, 2020

I am still so out of the loop. Damn sorry y'all

are you still having problem with downloading?

@dmfp
Copy link

@dmfp dmfp commented Oct 15, 2020

There's already a fixed for that. But the source code is not yet compiled.

Check this
#26775
#26723
#26701

@zackmark29 @lkho
Hi guys, I see a lot of discussion after this comment. Does this still stand? I.e. is the fix ready just pending compilation of a new version? Or are you guys working on newly discovered related bugs?

If it is still merely awaiting compilation, any idea which of the contributors is coordinating that? Will be happy to lend a voice to urge action.

@lkho
Copy link
Contributor

@lkho lkho commented Oct 15, 2020

the corresponding PR is here #26775

@lkho lkho linked a pull request that will close this issue Oct 15, 2020
6 of 6 tasks complete
@zackmark29
Copy link

@zackmark29 zackmark29 commented Oct 15, 2020

There's already a fixed for that. But the source code is not yet compiled.
Check this
#26775
#26723
#26701

@zackmark29 @lkho
Hi guys, I see a lot of discussion after this comment. Does this still stand? I.e. is the fix ready just pending compilation of a new version? Or are you guys working on newly discovered related bugs?

If it is still merely awaiting compilation, any idea which of the contributors is coordinating that? Will be happy to lend a voice to urge action.

It's already fixed the bugs. I think it's just pending for compilation.

@AlecHex
Copy link
Author

@AlecHex AlecHex commented Oct 18, 2020

There's already a fixed for that. But the source code is not yet compiled.
Check this
#26775
#26723
#26701

@zackmark29 @lkho
Hi guys, I see a lot of discussion after this comment. Does this still stand? I.e. is the fix ready just pending compilation of a new version? Or are you guys working on newly discovered related bugs?
If it is still merely awaiting compilation, any idea which of the contributors is coordinating that? Will be happy to lend a voice to urge action.

It's already fixed the bugs. I think it's just pending for compilation.

Just hoping to see a new update soon. I am not so good with technical stuff :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

7 participants
You can’t perform that action at this time.