Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
03a184cc
Commit
03a184cc
authored
May 12, 2007
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* videoportals.c: add title for metacafe vids.
parent
778d9193
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
17 deletions
+28
-17
modules/demux/playlist/videoportals.c
modules/demux/playlist/videoportals.c
+28
-17
No files found.
modules/demux/playlist/videoportals.c
View file @
03a184cc
...
@@ -45,6 +45,32 @@ struct demux_sys_t
...
@@ -45,6 +45,32 @@ struct demux_sys_t
char
*
psz_title
;
char
*
psz_title
;
};
};
char
*
get_html_meta_title
(
demux_t
*
p_demux
);
char
*
get_html_meta_title
(
demux_t
*
p_demux
)
{
char
*
psz_title
;
char
*
psz_cur
;
char
*
psz_line
;
/* Retreive the stream's title from the HTML */
while
(
(
psz_line
=
stream_ReadLine
(
p_demux
->
s
)
)
)
{
if
(
(
psz_cur
=
strstr
(
psz_line
,
"<meta name=
\"
title
\"
content=
\"
"
)
)
)
{
char
*
psz_buf
;
psz_cur
+=
strlen
(
"<meta name=
\"
title
\"
content=
\"
"
);
psz_buf
=
strchr
(
psz_cur
,
'"'
);
if
(
psz_buf
)
*
psz_buf
=
'\0'
;
psz_title
=
strdup
(
psz_cur
);
resolve_xml_special_chars
(
psz_title
);
if
(
psz_buf
)
*
psz_buf
=
'"'
;
return
psz_title
;
}
}
return
NULL
;
}
/*****************************************************************************
/*****************************************************************************
* Import_VideoPortal: main import function
* Import_VideoPortal: main import function
*****************************************************************************/
*****************************************************************************/
...
@@ -70,28 +96,12 @@ int E_(Import_VideoPortal)( vlc_object_t *p_this )
...
@@ -70,28 +96,12 @@ int E_(Import_VideoPortal)( vlc_object_t *p_this )
if
(
!
strncmp
(
psz_cur
,
"watch?v="
,
strlen
(
"watch?v="
)
)
)
if
(
!
strncmp
(
psz_cur
,
"watch?v="
,
strlen
(
"watch?v="
)
)
)
{
{
/* This is the webpage's url */
/* This is the webpage's url */
char
*
psz_line
;
char
*
psz_id
;
char
*
psz_id
;
psz_cur
+=
strlen
(
"watch?v="
);
psz_cur
+=
strlen
(
"watch?v="
);
psz_id
=
psz_cur
;
psz_id
=
psz_cur
;
psz_cur
=
strchr
(
psz_cur
,
'&'
);
psz_cur
=
strchr
(
psz_cur
,
'&'
);
if
(
psz_cur
)
*
psz_cur
=
'\0'
;
if
(
psz_cur
)
*
psz_cur
=
'\0'
;
/* Retreive the stream's title from the HTML */
psz_title
=
get_html_meta_title
(
p_demux
);
while
(
(
psz_line
=
stream_ReadLine
(
p_demux
->
s
)
)
)
{
if
(
(
psz_cur
=
strstr
(
psz_line
,
"<meta name=
\"
title
\"
content=
\"
"
)
)
)
{
char
*
psz_buf
;
psz_cur
+=
strlen
(
"<meta name=
\"
title
\"
content=
\"
"
);
psz_buf
=
strchr
(
psz_cur
,
'"'
);
if
(
psz_buf
)
*
psz_buf
=
'\0'
;
psz_title
=
strdup
(
psz_cur
);
resolve_xml_special_chars
(
psz_title
);
if
(
psz_buf
)
*
psz_buf
=
'"'
;
break
;
}
}
asprintf
(
&
psz_url
,
"http://www.youtube.com/v/%s"
,
psz_id
);
asprintf
(
&
psz_url
,
"http://www.youtube.com/v/%s"
,
psz_id
);
}
}
else
if
(
!
strncmp
(
psz_cur
,
"watch_fullscreen?video_id="
,
else
if
(
!
strncmp
(
psz_cur
,
"watch_fullscreen?video_id="
,
...
@@ -190,6 +200,7 @@ int E_(Import_VideoPortal)( vlc_object_t *p_this )
...
@@ -190,6 +200,7 @@ int E_(Import_VideoPortal)( vlc_object_t *p_this )
psz_cur
[
strlen
(
psz_cur
)
-
1
]
=
'\0'
;
psz_cur
[
strlen
(
psz_cur
)
-
1
]
=
'\0'
;
asprintf
(
&
psz_url
,
"http://www.metacafe.com/fplayer/%s.swf"
,
asprintf
(
&
psz_url
,
"http://www.metacafe.com/fplayer/%s.swf"
,
psz_cur
);
psz_cur
);
psz_title
=
get_html_meta_title
(
p_demux
);
}
}
else
if
(
(
psz_cur
=
strstr
(
psz_path
,
"images.metacafe.com"
)
)
)
else
if
(
(
psz_cur
=
strstr
(
psz_path
,
"images.metacafe.com"
)
)
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment