Commit f4e91040 authored by Antoine Cellerier's avatar Antoine Cellerier

videoportals.c: Add metacafe URL support.

parent 04eab2d9
...@@ -56,6 +56,7 @@ int E_(Import_VideoPortal)( vlc_object_t *p_this ) ...@@ -56,6 +56,7 @@ int E_(Import_VideoPortal)( vlc_object_t *p_this )
byte_t *p_peek; byte_t *p_peek;
int i_peek; int i_peek;
printf(">>> %s\n", psz_path );
/* YouTube */ /* YouTube */
if( ( psz_cur = strstr( psz_path, "youtube.com" ) ) ) if( ( psz_cur = strstr( psz_path, "youtube.com" ) ) )
{ {
...@@ -131,6 +132,31 @@ int E_(Import_VideoPortal)( vlc_object_t *p_this ) ...@@ -131,6 +132,31 @@ int E_(Import_VideoPortal)( vlc_object_t *p_this )
docid ); docid );
} }
} }
/* metacafe */
else if( ( psz_cur = strstr( psz_path, "metacafe.com" ) ) )
{
if( strstr( psz_cur, "watch/" ) )
{
psz_cur = strstr( psz_cur, "watch/" );
psz_cur += strlen( "watch/" );
if( psz_cur[strlen(psz_cur)-1] == '/' )
psz_cur[strlen(psz_cur)-1] = '\0';
asprintf( &psz_url, "http://www.metacafe.com/fplayer/%s.swf",
psz_cur );
}
else if( ( psz_cur = strstr( psz_path, "images.metacafe.com" ) ) )
{
if( ( psz_cur = strstr( psz_cur, "mediaURL=" ) ) )
{
char *psz_tmp;
psz_cur += strlen( "mediaURL=" );
psz_tmp = strchr( psz_cur, '&' );
*psz_tmp = 0;
psz_url = strdup( psz_cur );
*psz_tmp = '&';
}
}
}
if( !psz_url ) if( !psz_url )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment