After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 635709 - Parse links to video websites
Parse links to video websites
Status: RESOLVED FIXED
Product: totem-pl-parser
Classification: Core
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: totem-pl-parser-maint
totem-pl-parser-maint
Depends on:
Blocks: 567801
 
 
Reported: 2010-11-24 16:30 UTC by Bastien Nocera
Modified: 2010-12-14 14:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Parse links to video websites (9.73 KB, patch)
2010-11-24 16:31 UTC, Bastien Nocera
none Details | Review
Parse links to video websites (10.08 KB, patch)
2010-11-24 17:51 UTC, Bastien Nocera
reviewed Details | Review
Parse links to video websites (11.17 KB, patch)
2010-11-25 15:44 UTC, Bastien Nocera
none Details | Review
Parse links to video websites (13.33 KB, patch)
2010-11-25 17:59 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2010-11-24 16:30:58 UTC
Useful to support YouTube and all for cheap.
Comment 1 Bastien Nocera 2010-11-24 16:31:00 UTC
Created attachment 175179 [details] [review]
Parse links to video websites

And load them up as videos.
Comment 2 Bastien Nocera 2010-11-24 16:33:46 UTC
Problems with quvi:
- License not compatible with totem-pl-parser
- Doesn't parse time in URLs (eg. http://www.youtube.com/watch?v=YwdGlRFb--s#t=2m25s)
- Doesn't have a function to check whether a link would be supported (without doing network I/O)
Comment 3 Bastien Nocera 2010-11-24 16:42:05 UTC
Example output from my favourite test video:

$ ./parser -d http://www.youtube.com/watch?v=oMLCrzy9TEs
** Message: Added URI "http://youtube.com/get_video?video_id=oMLCrzy9TEs&t=vjVQa1PpcFO1HO48-86SuiYNVCuwEjlk0ynVhPMA0ho=&asv=2"...
** Message: 	moreinfo = 'http://www.youtube.com/watch?v=oMLCrzy9TEs'
** Message: 	title = 'Utah Saints Something Good '08 : Download OUT NOW!!'
** Message: 	id = 'oMLCrzy9TEs'
** Message: 	filesize = '7959887'
Comment 4 Bastien Nocera 2010-11-24 16:43:48 UTC
Oh, I should also add that that code is missing the ability to select the video quality. This should be implemented through a property on totem-pl-parser that Totem would set.
Comment 5 Bastien Nocera 2010-11-24 17:51:02 UTC
Created attachment 175188 [details] [review]
Parse links to video websites

And load them up as videos. Has an identifier function that
could be used with the mini parser.
Comment 6 Philip Withnall 2010-11-24 20:08:27 UTC
Review of attachment 175188 [details] [review]:

Looks good so far! :-D

::: plparse/totem-pl-parser-videosite.c
@@ +2,3 @@
+   Copyright (C) 2010 Bastien Nocera <hadess@hadess.net>
+
+   The Gnome Library is free software; you can redistribute it and/or

“The Gnome Library”?

@@ +112,3 @@
+
+	return TOTEM_PL_PARSER_RESULT_SUCCESS;
+#endif /* !HAVE_QUVI */

Might want to make this an #else — I guess gcc might complain about an unreachable return statement otherwise.
Comment 7 Bastien Nocera 2010-11-25 12:14:08 UTC
(In reply to comment #6)
<snip>
> ::: plparse/totem-pl-parser-videosite.c
> @@ +2,3 @@
> +   Copyright (C) 2010 Bastien Nocera <hadess@hadess.net>
> +
> +   The Gnome Library is free software; you can redistribute it and/or
> 
> “The Gnome Library”?

Copy paste from another .c file in the same dir.

> @@ +112,3 @@
> +
> +    return TOTEM_PL_PARSER_RESULT_SUCCESS;
> +#endif /* !HAVE_QUVI */
> 
> Might want to make this an #else — I guess gcc might complain about an
> unreachable return statement otherwise.

Fair enough.

Another bug in quvi:
- http://www.dailymotion.com/swf/video/xfrrlu?autoPlay=1 cannot be parsed
- http://www.dailymotion.com/video/xfrrlu?autoPlay=1 works
Comment 8 Bastien Nocera 2010-11-25 15:44:49 UTC
Created attachment 175241 [details] [review]
Parse links to video websites

And load them up as videos. Has an identifier function that
could be used with the mini parser.

Also expand the starttime parsing to include the YouTube format.
Comment 9 Bastien Nocera 2010-11-25 15:46:03 UTC
All the wishlist bugs for quvi are fixed, just left with the licensing problem...
Comment 10 Bastien Nocera 2010-11-25 17:59:59 UTC
Created attachment 175260 [details] [review]
Parse links to video websites

And load them up as videos. Add totem_pl_parser_can_parse_from_uri
that could be used with the mini parser.

Expand the starttime parsing to include the YouTube format.
Comment 11 Philip Withnall 2010-11-26 00:43:13 UTC
Review of attachment 175260 [details] [review]:

A few minor things I spotted.

::: plparse/totem-pl-parser.c
@@ +2470,3 @@
+ * Checks if the remote URI can be parsed. Note that this does
+ * not actually try to open the remote URI, or deduce its mime-type
+ * from filename, as this would bring too many false positives.

s/mime-type/content type/, s/from filename/from its filename/.

@@ +2472,3 @@
+ * from filename, as this would bring too many false positives.
+ *
+ * Return value: %TRUE if @uri could be parsed

This needs a @Since gtk-doc line, and it needs to be added to totem-pl-parser-sections.txt.
Comment 12 Bastien Nocera 2010-11-26 14:39:36 UTC
(In reply to comment #11)
<snip>
> This needs a @Since gtk-doc line, and it needs to be added to
> totem-pl-parser-sections.txt.

It's a function in totem-pl-parser-mini, and all of those functions are undocumented.
Comment 13 Frederic Peters 2010-12-10 20:19:24 UTC
It has been pushed as http://git.gnome.org/browse/totem-pl-parser/commit/?id=cd7fc1f7ad4a39

Is this an error, or has the license issue been resolved?

Also I noticed this as a build failure on a build slave,
  http://build.gnome.org/builders/totem-pl-parser-bxlug-sid/builds/1107/steps/totem-pl-parser%20build/logs/stdio

It looks like "--enable-quvi  Enable libquvi support (default is auto)" isn't true.

enable_quvi=auto
AC_ARG_ENABLE(enable-quvi,
              AS_HELP_STRING([--enable-quvi],
                             [Enable libquvi support (default is auto).]),
                             [enable_quvi=no],
                             [enable_quvi=yes])

The last line should be enable_quvi=$enable_quvi (or =auto).
Comment 14 Bastien Nocera 2010-12-13 19:01:03 UTC
See also:
http://sourceforge.net/apps/trac/quvi/ticket/9
Comment 15 Bastien Nocera 2010-12-14 14:06:59 UTC
Attachment 175260 [details] pushed as e3feb71 - Parse links to video websites
Comment 16 Frederic Peters 2010-12-14 14:20:27 UTC
It doesn't build if quvi is not installed:

…
checking for QUVI... no
…
totem-pl-parser-videosite.c: In function 'totem_pl_parser_is_videosite':
totem-pl-parser-videosite.c:42: error: 'quvi_t' undeclared (first use in this function)
…

http://build.gnome.org/builders/totem-pl-parser-bxlug-sid/builds/1116/steps/totem-pl-parser%20build/logs/stdio
Comment 17 Bastien Nocera 2010-12-14 14:52:16 UTC
Fixed in master.