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

[Bug] Kijk.nl video not detected #7223

Open
Reino17 opened this issue Oct 18, 2015 · 2 comments
Open

[Bug] Kijk.nl video not detected #7223

Reino17 opened this issue Oct 18, 2015 · 2 comments

Comments

@Reino17
Copy link

@Reino17 Reino17 commented Oct 18, 2015

youtube-dl.exe -vF http://www.kijk.nl/sbs6/k3zoektk3/videos/rZsxhcyhEn6/show-7
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-vF', u'http://www.kijk.nl/sbs6/k3zoektk3/videos/rZsxhcyhEn6/s
how-7']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2015.10.16
[debug] Python version 2.7.8 - Windows-XP-5.1.2600-SP3
[debug] exe versions: ffmpeg N-75746-g84b4998
[debug] Proxy map: {}
[generic] show-7: Requesting header
WARNING: Falling back on generic information extractor.
[generic] show-7: Downloading webpage
[generic] show-7: Extracting information
[generic] Brightcove video detected.
[download] Downloading playlist: K3 zoekt k3 - Show 7 - SBS6 - KIJK
[generic] playlist K3 zoekt k3 - Show 7 - SBS6 - KIJK: Collected 1 video ids (downloading 1 
of them)
[download] Downloading video 1 of 1
[Brightcove] 4562855897001: Downloading webpage
[Brightcove] 4562855897001: Extracting information
[info] Available formats for 4562855897001:
format code  extension      resolution note
0            unknown_video  480x360
youtube-dl.exe -g http://www.kijk.nl/sbs6/k3zoektk3/videos/rZsxhcyhEn6/show-7
WARNING: Falling back on generic information extractor.
http://l3c.cdn.sbsnet.nl/

I don't have much experience with Python, but with the help of Xidel, which I use in my own script, I get the same result:

xidel.exe -q "http://www.kijk.nl/sbs6/k3zoektk3/videos/rZsxhcyhEn6/show-7" -f replace(replac
e(//meta[@property='og:video']/@content,'federated_f9','htmlFederated'),'videoId','@videoPla
yer')" -e "json(extract($raw,'experienceJSON = ({.+});',1))//mediaDTO/renditions" | jq.exe .
[
  {
    "audioOnly": false,
    "defaultURL": null,
    "encodingRate": 2085000,
    "frameHeight": 488,
    "frameWidth": 868,
    "mediaDeliveryType": 1,
    "remote": true,
    "size": 1367948294,
    "videoCodec": "H264",
    "videoContainer": 1
  },
  {
    "audioOnly": false,
    "defaultURL": null,
    "encodingRate": 1465000,
    "frameHeight": 432,
    "frameWidth": 768,
    "mediaDeliveryType": 1,
    "remote": true,
    "size": 895542479,
    "videoCodec": "H264",
    "videoContainer": 1
  },
  {
    "audioOnly": false,
    "defaultURL": "http://l3c.cdn.sbsnet.nl/",
    "encodingRate": 0,
    "frameHeight": 360,
    "frameWidth": 480,
    "mediaDeliveryType": 1,
    "remote": true,
    "size": 0,
    "videoCodec": "H264",
    "videoContainer": 1
  },
  {
    "audioOnly": false,
    "defaultURL": null,
    "encodingRate": 1116000,
    "frameHeight": 360,
    "frameWidth": 640,
    "mediaDeliveryType": 1,
    "remote": true,
    "size": 687839304,
    "videoCodec": "H264",
    "videoContainer": 1
  },
  {
    "audioOnly": false,
    "defaultURL": null,
    "encodingRate": 450000,
    "frameHeight": 180,
    "frameWidth": 320,
    "mediaDeliveryType": 1,
    "remote": true,
    "size": 307813990,
    "videoCodec": "H264",
    "videoContainer": 1
  },
  {
    "audioOnly": false,
    "defaultURL": null,
    "encodingRate": 866000,
    "frameHeight": 288,
    "frameWidth": 512,
    "mediaDeliveryType": 1,
    "remote": true,
    "size": 515283083,
    "videoCodec": "H264",
    "videoContainer": 1
  }
]

"http://l3c.cdn.sbsnet.nl/" would normally be a full manifest-playlist-url like "http://l3c.cdn.sbsnet.nl/ra/01/440347551d0185aa1e85c22e55f1bec520ed92/hls/sbs6_k3zoektk3_S2015E06_151010002903440347-hls-main.m3u8" for show 6, but apparently not for this video.
The video does play in my browser though and the video source is also still:

xidel.exe -q "http://www.kijk.nl/sbs6/k3zoektk3/videos/rZsxhcyhEn6/show-7" -e "//meta[@prope
rty='og:video']/@content
http://c.brightcove.com/services/viewer/federated_f9?isVid=1&isUI=1&publisherID=20318290001&
playerID=2234112204001&autoStart=false&domain=embed&videoId=4562855897001&branding=sbs&playe
rtitle=true&linkBaseURL=http://www.kijk.nl/sbs6/k3zoektk3/videos/rZsxhcyhEn6/show-7?sbs_devi
ce=pc

which also plays fine if you open this url directly in your browser, but I can't seem to analyse/parse it any further to actually find the mp4/m3u8-url.

@Reino17
Copy link
Author

@Reino17 Reino17 commented Feb 14, 2016

Most likely the reason why the video did play in my internetbrowser was because of progressive videostreams, which I didn't know existed at the time.
These require another, but simpler, extraction method.
You'd first have to extract the 'videoId', which for the example above is 4562855897001. It can be found in the brightcove-url and in the 'experienceJSON' (attribute 'id'). Then put together this url, http://hbb.sbs6.nl/backend/veamerapi/index/method/video/device/samsung-tv-2012/brightCoveId/[videoId], which returns a json.

http://hbb.sbs6.nl/backend/veamerapi/index/method/video/device/samsung-tv-2012/brightCoveId/4572434555001:

{
  "videos": [
    "http://stv.cdn.sbsnet.nl/ra/01/452414879bfbf14cf8d97ee6fbcf38541df530/mp4/sbs6_k3zoektk
3_S2015E07_151022135534452414-bg-350.mp4",
    "http://stv.cdn.sbsnet.nl/ra/01/452414879bfbf14cf8d97ee6fbcf38541df530/mp4/sbs6_k3zoektk
3_S2015E07_151022135459452414-bg-650.mp4",
    "http://stv.cdn.sbsnet.nl/ra/01/452414879bfbf14cf8d97ee6fbcf38541df530/mp4/sbs6_k3zoektk
3_S2015E07_151022135421452414-bg-900.mp4",
    "http://stv.cdn.sbsnet.nl/ra/01/452414879bfbf14cf8d97ee6fbcf38541df530/mp4/sbs6_k3zoektk
3_S2015E07_151022135345452414-bg-1200.mp4",
    "http://stv.cdn.sbsnet.nl/ra/01/452414879bfbf14cf8d97ee6fbcf38541df530/mp4/sbs6_k3zoektk
3_S2015E07_151022135301452414-bg-1885.mp4"
  ],
  "videoLength": 5533960,
  "tags": [
    "k3zoektk3",
    "vod",
    "sbs6"
  ],
  "playsTotal": 35367,
  "customFields": {
    "sko_t": "2037",
    "sbs_videotype": "vod",
    "sko_prid": "333577749",
    "sko_pr": "k3_zoekt_k3",
    "sbs_episode": "S2015E07",
    "sbs_station": "sbs6",
    "sko_stid": "63",
    "sko_dt": "20151016",
    "sko_ty": "tv.ep",
    "sbs_program": "K3 zoekt K3",
    "sbs_adpolicy": "long",
    "nlz_cst_id": "rZsxhcyhEn6",
    "ns_st_pl": "K3 zoekt K3: Show 7",
    "ns_st_ep": "S2015E07",
    "ns_st_pr": "K3 zoekt K3",
    "ns_st_st": "K3 zoekt K3",
    "ns_st_dt": "20151016",
    "ns_st_cl": 5533960,
    "ns_st_el": 5533960,
    "ns_st_fee": "0",
    "ns_st_pn": "1",
    "ns_st_tp": "1",
    "ns_st_ty": "tv.ep",
    "ns_st_cid": 4572434555001,
    "ns_st_ctitle": "K3 zoekt K3",
    "ns_st_tags": "k3zoektk3,vod,sbs6"
  },
  "advertisements": [
    {
      "position": "preroll",
      "url": "http://nl-sbs.videoplaza.tv/proxy/distributor/v2?rt=vast_2.0.1&t=%PLAYER%,sbs6
,K3 zoekt K3,vod,S2015E07&cf=long_form&rnd=%RANDOM%&tt=p&vbw=2000&vwt=1280&vht=720&dcid=conn
ectedtv&s=sbs6/K3 zoekt K3"
    },
    {
      "position": "postroll",
      "url": "http://nl-sbs.videoplaza.tv/proxy/distributor/v2?rt=vast_2.0.1&t=%PLAYER%,sbs6
,K3 zoekt K3,vod,S2015E07&cf=long_form&rnd=%RANDOM%&tt=po&vbw=2000&vwt=1280&vht=720&dcid=con
nectedtv&s=sbs6/K3 zoekt K3"
    }
  ]
}

And as you can see, the video-urls are right there.
Perhaps you can add support for these.

@dstftw dstftw mentioned this issue Nov 22, 2017
1 of 5 tasks complete
@Reino17
Copy link
Author

@Reino17 Reino17 commented Dec 9, 2017

#14826 (comment):

Duplicate of #7223.

@dstftw, I see you closed a couple of duplicate issues lately and refer them to this one.

A lot has changed on kijk.nl. If you know xquery, then you could have a look at my code and my notes on the matter.

As you can see, I simply use regex to extract the program-id from the url.
If you need to open the url itself, then a cookie is required:

xidel.exe -s "http://www.sbs6.nl/images/setcookie.png" -f "'http://www.sbs6.nl/programmas/mensenkennis/videos/9Zb61du3kCD/mensenkennis/'" -e "//script/extract(.,'INITIAL_STATE__ = (.+\});',1) ! json(.)//provider_url"
http://www.kijk.nl/video/9Zb61du3kCD

xidel.exe -s "http://www.kijk.nl/img/setcookie.png" -f "'http://www.kijk.nl/net5/pekingexpress/videos/w7ZW52xLgL5/aflevering-1'" -e "//meta[@property='og:url']/@content"
https://www.kijk.nl/net5/pekingexpress/videos/w7ZW52xLgL5/aflevering-1

This is how it's done with Xidel. I can't help you with Python.

@Reino17 Reino17 mentioned this issue Dec 9, 2017
1 of 5 tasks complete
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.

None yet
1 participant
You can’t perform that action at this time.