An IE for canalplus.fr #674

Closed
opened 2026-02-20 23:10:07 -05:00 by deekerman · 6 comments
Owner

Originally created by @yasoob on GitHub (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.

Originally created by @yasoob on GitHub (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.
Author
Owner

@oluc commented on GitHub (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>
@oluc commented on GitHub (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> ```
Author
Owner

@yasoob commented on GitHub (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.

@yasoob commented on GitHub (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.
Author
Owner

@oluc commented on GitHub (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?

@oluc commented on GitHub (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?
Author
Owner

@yasoob commented on GitHub (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

@yasoob commented on GitHub (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
Author
Owner

@jaimeMF commented on GitHub (Jul 13, 2013):

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

@jaimeMF commented on GitHub (Jul 13, 2013): Thanks to both of you for the information, I've added an InfoExtractor.
Author
Owner

@yasoob commented on GitHub (Jul 13, 2013):

Thanx @jaimeMF 👍

@yasoob commented on GitHub (Jul 13, 2013): Thanx @jaimeMF :+1:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#674
No description provided.