GNOME Bugzilla – Bug 635709
Parse links to video websites
Last modified: 2010-12-14 14:52:16 UTC
Useful to support YouTube and all for cheap.
Created attachment 175179 [details] [review] Parse links to video websites And load them up as videos.
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)
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'
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.
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.
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.
(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
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.
All the wishlist bugs for quvi are fixed, just left with the licensing problem...
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.
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.
(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.
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).
See also: http://sourceforge.net/apps/trac/quvi/ticket/9
Attachment 175260 [details] pushed as e3feb71 - Parse links to video websites
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
Fixed in master.