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

An IE for canalplus.fr #918

Closed
yasoob opened this issue Jun 24, 2013 · 6 comments
Closed

An IE for canalplus.fr #918

yasoob opened this issue Jun 24, 2013 · 6 comments

Comments

@yasoob
Copy link
Contributor

@yasoob yasoob commented Jun 24, 2013

We can make an IE for canalplus.fr as requested in #59
An example url is http://www.canalplus.fr/c-divertissement/pid3351-c-le-petit-journal.html?vid=889861
We just have to request http://service.canal-plus.com/video/rest/getVideosLiees/cplus/<vid_id> It returns an XML document with all the rtmp urls. It gives us three types of urls. One for low quality. Another for high quality and another for hd. Now the only thing which is left to be figured out is what should be the complete rtmpdump command for downloading the video.

@oluc
Copy link

@oluc oluc commented Jun 26, 2013

I am not sure which technology you are using, but I could get the video with the following script (using 'curl') and XSL stylesheet:

INPUT=$1
VIDEO_ID=${INPUT#*vid=}
URL_BASE=http://service.canal-plus.com/video/rest/getVideosLiees/cplus/

URL_FILE=$URL_BASE/$VIDEO_ID
XML_FILE=$VIDEO_ID.xml
curl --silent $URL_FILE > $XML_FILE

MP4_URL=`xsltproc get-canal-HD-filename.xsl $XML_FILE`
echo "Fetching" ${MP4_URL##*/}
curl $MP4_URL > ${MP4_URL##*/}

\rm -f $XML_FILE
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>

  <xsl:template match="*">
    <xsl:apply-templates select="/VIDEOS/VIDEO/MEDIA/VIDEOS/HD"/>
  </xsl:template>

  <xsl:template match="/VIDEOS/VIDEO/MEDIA/VIDEOS/HD">
    <xsl:value-of select="."/>
  </xsl:template>

</xsl:stylesheet>
@yasoob
Copy link
Contributor Author

@yasoob yasoob commented Jun 26, 2013

@oluc can you explain a little bit. You open http://service.canal-plus.com/video/rest/getVideosLiees/cplus/<vid_id> then you save it . What are you doing after that with XSL stylesheet ? I am not that much experienced with shell so a little guidance will be very helpful.

@oluc
Copy link

@oluc oluc commented Jun 26, 2013

The XSL stylesheet gets the content of the node /VIDEOS/VIDEO/MEDIA/VIDEOS/HD in the XML, which contains the URL of the HD mp4. If you use python, maybe you have an easy API to access this node without XSL. For example, with vid_id 892479, we get rtmp://vod-fms.canalplus.fr/ondemand/videos/1306/LE_GRAND_JOURNAL_LA_METEO_DE_DORIA_130625_CAN_350114_video_HD.mp4

Then I fetch that mp4 with 'curl', which supports the RTMP protocol

This ${MP4_URL##*/} means everything after the last '/', which is the mp4 filename.

Does it help?

@yasoob
Copy link
Contributor Author

@yasoob yasoob commented Jun 27, 2013

You can hope to have its support in the next release of youtube-dl. But i am not making any promises. It will still take some time to implement it in youtube-dl

@jaimeMF jaimeMF closed this in ffca4b5 Jul 13, 2013
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 13, 2013

Thanks to both of you for the information, I've added an InfoExtractor.

@yasoob
Copy link
Contributor Author

@yasoob yasoob commented Jul 13, 2013

Thanx @jaimeMF 👍

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
3 participants
You can’t perform that action at this time.