add patch from upstream svn repository to fix youtube plugin
authorMarkos Chandras <hwoarang@gentoo.org>
Sun, 14 Aug 2011 13:11:31 +0000 (13:11 +0000)
committerMarkos Chandras <hwoarang@gentoo.org>
Sun, 14 Aug 2011 13:11:31 +0000 (13:11 +0000)
Package-Manager: portage-2.2.0_alpha50/cvs/Linux x86_64

media-video/xvideoservicethief/ChangeLog
media-video/xvideoservicethief/Manifest
media-video/xvideoservicethief/files/xvideoservicethief-2.4.1-youtube-api.patch [new file with mode: 0644]
media-video/xvideoservicethief/xvideoservicethief-2.4.1-r1.ebuild [new file with mode: 0644]

index f7eb47525cdf4f26c940a47d843339dbfaa78cc9..4ed0032ac083d33243914b5e2216aeeba4415b10 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for media-video/xvideoservicethief
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/xvideoservicethief/ChangeLog,v 1.23 2011/05/01 21:30:39 hwoarang Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/xvideoservicethief/ChangeLog,v 1.24 2011/08/14 13:11:31 hwoarang Exp $
+
+*xvideoservicethief-2.4.1-r1 (14 Aug 2011)
+
+  14 Aug 2011; Markos Chandras <hwoarang@gentoo.org>
+  +xvideoservicethief-2.4.1-r1.ebuild,
+  +files/xvideoservicethief-2.4.1-youtube-api.patch:
+  add patch from upstream svn repository to fix youtube plugin
 
   01 May 2011; Markos Chandras <hwoarang@gentoo.org>
   -xvideoservicethief-2.4.ebuild, xvideoservicethief-2.4.1.ebuild:
index 8d60a23f7af0bfc7f516353e386e92d33e452bfa..53cf473e9e098cf678dcee612349e440906ab365 100644 (file)
@@ -1,24 +1,26 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA512
 
+AUX xvideoservicethief-2.4.1-youtube-api.patch 7972 RMD160 de47121936e5da80d6cd6fb7275bfe6b6b3fd4ba SHA1 7965602c033a90e06a0dfff7be27f2a8e3541aa3 SHA256 e0d22c518efb2c65ad01d4845c0445fd068f98c1ea4c2fc1f31bc569b9873956
 DIST xVST_2_4_1_src.zip 3817619 RMD160 66d17eff3c5334b585848a0defa7dfde03465aa3 SHA1 97bb364fc2cae2ca44eb3e9b19cc5f25b9818658 SHA256 cbd1f24156bdb6e3527b5b4d6823441881462442b9aeeb36098abcf16fbe7a29
+EBUILD xvideoservicethief-2.4.1-r1.ebuild 2435 RMD160 efdf832c85bdf2f38dc207360667ee28367f8ca6 SHA1 79e4ae9f3f72d27444570befe87f6d3bd85d2cef SHA256 168d3e73c64a6dcb2a168d08b9b8cc085fc47275ad8001e5dfd87d5cc6885785
 EBUILD xvideoservicethief-2.4.1.ebuild 2385 RMD160 7b7467d67bd984515341a87131c0674bdff41bfd SHA1 cbfb125d9de044952c87867a19f042005f7fe2bd SHA256 124c043c3b4796caccdf63fa367a1feac8a74b71c745757df6cfe833e1bde056
-MISC ChangeLog 3759 RMD160 7d3740f6b5130fe5f17000344b2b1aa3d19c0af8 SHA1 8003f61d5b6a9db1bb8394499a1f91ac50f2ead8 SHA256 d581089e7a0a6d089a8368f6489e5e37a7797cb55f14227896a5a8e7dbf995d0
+MISC ChangeLog 4012 RMD160 598cdb4aedb02c723e917d3eca1d94be0f2ca568 SHA1 24eee6a854cf891e8c919c8ae37af046ef7cdd60 SHA256 7accbb4838ef7b88004370d15baf2e806ce690c2839262ad723bdf551968ade6
 MISC metadata.xml 277 RMD160 d0901c2e5b1ad8ecc4e524e24397caa3f83224ca SHA1 2c00106871950270b41b7d669d36999d604907e4 SHA256 088b359fa836214a4429a6f7e7d7e3c82234a0c2e84da475c8b92f7f566f39cb
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.17 (GNU/Linux)
+Version: GnuPG v2.0.18 (GNU/Linux)
 
-iQIcBAEBCgAGBQJNvdD7AAoJEPqDWhW0r/LClO8P/RljaEHDCvH230Qzv8afpiHH
-H2h/fzYGNi8S90M4ESeF8KEdPFkVk2fM7SEUB4UKnE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4CuRS81jKGKyi4LljRnEAMfBXbOPWCH+feRHYT+eDOU6gUZqmdb
+R1IVcJBM05Y4dX/M+APoKz2PqTShrQv7B3qeO/vz8cxJBni6zegwu21+Nkgrg510
+EwcQsEZsJGpC4Katz216ZZ1uK+NF6ATkQEvUAoXqKHsEMsvrLdcpx8YMzRwoD6a6
+6DWw0P9A/zmsfs1RV2JkfM88wCyWIhYz8cJI1NA8h7bl0zAF4cTGYjENt9rPamyg
+Gvo3l5byyKjcN3EKZ7vHDNOsp6gQyqUUGuB9E7KuEbBl6O9XPRdXXIwd4Vp6odDX
+LqH30+yv4n6knBDZo1di
+=MGrP
 -----END PGP SIGNATURE-----
diff --git a/media-video/xvideoservicethief/files/xvideoservicethief-2.4.1-youtube-api.patch b/media-video/xvideoservicethief/files/xvideoservicethief-2.4.1-youtube-api.patch
new file mode 100644 (file)
index 0000000..50f6bbe
--- /dev/null
@@ -0,0 +1,188 @@
+--- resources/services/youtube/youtube.js      2010/09/02 11:52:07     911
++++ resources/services/youtube/youtube.js      2011/08/06 23:30:28     961
+@@ -3,7 +3,7 @@
+ * This file is part of xVideoServiceThief,
+ * an open-source cross-platform Video service download
+ *
+-* Copyright (C) 2007 - 2010 Xesc & Technology
++* Copyright (C) 2007 - 2011 Xesc & Technology
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -25,9 +25,9 @@
+ 
+ function RegistVideoService()
+ {
+-      this.version = "2.1.5";
++      this.version = "3.0.1";
+       this.minVersion = "2.0.0a";
+-      this.author = "Xesc & Technology 2009";
++      this.author = "Xesc & Technology 2011";
+       this.website = "http://www.youtube.com/";
+       this.ID = "youtube.com";
+       this.caption = "YouTube";
+@@ -55,32 +55,103 @@
+       // download webpage
+       var http = new Http();
+       var html = http.downloadWebpage(youTubeURL);
++      // get cookies
++      result.cookies = http.getCookies("|");
+       // get the video title
+       result.title = copyBetween(html, "<title>", "</title>");
+       result.title = normalizeSpaces(result.title);
++      result.title = strReplace(result.title, "\n", "");
++      result.title = strReplace(result.title, " - YouTube", "");
+       // check if this video need a login
+-      result.needLogin = result.title == "Broadcast Yourself.";
++      result.needLogin = strIndexOf(html, "signing_in") != -1;
+       // if we can continue (no loggin needed)
+       if (result.needLogin) return result;
+-      // get the video info block
+-      var dirtyUrl = copyBetween(html, "fmt_stream_map=", "34%7Chttp");
+-      // we have an empty "dirtyUrl"?? if yes then we give it a second try
+-      if (dirtyUrl == "") dirtyUrl = copyBetween(html, "fmt_url_map=", "&") + "&";
+-      // get the video resolution
+-      var vidRes = getToken(dirtyUrl, "%7C", 0);
+-      // check if is a HD_VIDEO_RES (for HD videos the extension is mp4)
+-      if (vidRes == HD_VIDEO_RES) result.extension = ".mp4";
+-      // get the video url
+-      result.URL = getToken(dirtyUrl, "%7C", 1);
+-      // convert the hex codes to ascii
+-      result.URL = cleanUrl(result.URL);
+-      // remove the last "," and replace it with an "&" (if is needed)
+-      if (strLastIndexOf(result.URL, "&") < strLastIndexOf(result.URL, ","))
+-              result.URL = strRemove(result.URL, strLastIndexOf(result.URL, ","), result.URL.toString().length) + "&";                
++      // get the video URL and extension
++      var videoInfo = getVideoUrlAndExtension(html);
++      result.URL = videoInfo.url;
++      result.extension = videoInfo.extension;
+       // return the video information
+       return result;
+ }
+ 
++function getVideoUrlAndExtension(html)
++{
++      // init result
++      var result = { url:null, extension:null };
++      // get the flashVars value
++      var flashVars = "?" + copyBetween(html, 'flashvars="', '"');
++      // convert each "&amp;" into "&"
++      flashVars = strReplace(flashVars, "&amp;", "&");
++      // get an array with all fmt_stream_map values
++      var fmt_stream_map_arr = splitString(getUrlParam(flashVars, "url_encoded_fmt_stream_map"), "url%3D", false);
++      // default selected video quality
++      var selectedFormat = -1;
++      // detect the better quality
++      for (var n = 0; n < fmt_stream_map_arr.length && selectedFormat == -1; n++)
++      {
++              fmt_stream_map_arr[n] = "?url=" + cleanUrl(fmt_stream_map_arr[n]).toString();
++              // remove the last "," (if exists)
++              if (strLastIndexOf(fmt_stream_map_arr[n], ",") == fmt_stream_map_arr[n].toString().length - 1)
++                      fmt_stream_map_arr[n] = strRemove(fmt_stream_map_arr[n], fmt_stream_map_arr[n].toString().length - 1, 1);
++              // check video type
++              var vtype = getToken(getUrlParam(fmt_stream_map_arr[n], "type"), ";", 0);
++              // is known format?
++              if (vtype == "video/x-flv" || vtype == "video/mp4")
++              {
++                      selectedFormat = n;
++                      // configure video extension
++                      result.extension = extensionFromVideoType(vtype);
++              }
++      }
++      // no format selected?
++      if (selectedFormat == -1) selectedFormat = 0;
++      // get the host url
++      var urlHost = getToken(fmt_stream_map_arr[selectedFormat], "?", 1);
++      urlHost = strReplace(urlHost, "url=", "");
++      // leave only the parameters
++      fmt_stream_map_arr[selectedFormat] = getToken(fmt_stream_map_arr[selectedFormat], "?", 2);
++      // get url parts
++      var urlParts = splitString(fmt_stream_map_arr[selectedFormat], "&", false);
++      // set the url host
++      result.url = urlHost + "?";
++      // build the initial url
++      for (var n = 0; n < urlParts.length; n++)
++      {
++              var pname = getToken(urlParts[n], "=", 0).toString();
++              var pvalue = getToken(urlParts[n], "=", 1).toString();
++              var duplicatedPname = strIndexOf(result.url, pname + "=") != -1;
++              // is an excluded param?                
++              if (!duplicatedPname && pname != "fexp" && pname != "quality" && pname != "fallback_host" && pname != "type") 
++                      result.url += pname + "=" + pvalue + "&";
++      }
++      // remove the last &
++      if (strLastIndexOf(result.url, "&") == result.url.length - 1)
++              urlInitial = strRemove(result.url, result.url.length - 1, 1);
++      // get extra (optional) params
++      var ptchn = getUrlParam(flashVars, "ptchn");
++      if (ptchn != "") result.url += "ptchn=" + ptchn + "&";
++      var ptk = getUrlParam(flashVars, "ptk");
++      if (ptk != "") result.url += "ptk=" + ptk;
++      // configure the video extension (if is not yet configured)
++      if (!result.extension)
++      {
++              var vtype = getToken(getUrlParam(fmt_stream_map_arr[selectedFormat], "type"), ";", 0);
++              // configure video extension
++              result.extension = extensionFromVideoType(vtype);
++      }
++      // return 
++      return result;
++}
++
++function extensionFromVideoType(vtype)
++{
++      if (vtype == "video/x-flv") return ".flv";
++      if (vtype == "video/mp4") return ".mp4";
++      if (vtype == "video/webm") return ".webm";
++      // default extension
++      return ".flv";
++}
++
+ /* 
+       This function "normalizeSpaces(str)" will be deprecated on next xVST version
+       and replaced with the new "simplifyString(str)" function (added in xVST 2.3.1)
+@@ -99,9 +170,11 @@
+ function searchVideos(keyWord, pageIndex)
+ {
+       const URL_SEARCH = "http://www.youtube.com/results?search_query=%1&page=%2&hl=%3";
+-      const HTML_SEARCH_START = "<!-- start search results -->";
+-      const HTML_SEARCH_FINISH = "<!-- end search results -->";
+-      const HTML_SEARCH_SEPARATOR = '<div class="video-entry">';
++      const HTML_SEARCH_START = '<div id="search-results">';
++      const HTML_SEARCH_FINISH = '<span id="search-pva-content">';
++      const HTML_SEARCH_SEPARATOR = '<div class="result-item *sr ">';
++      const HTML_SEARCH_SUMMARY_START = '<p class="num-results">';
++      const HTML_SEARCH_SUMMARY_END = '</p>';
+       // replace all spaces for "+"
+       keyWord = strReplace(keyWord, " ", "+");
+       // init search results object
+@@ -110,7 +183,7 @@
+       var http = new Http();
+       var html = http.downloadWebpage(strFormat(URL_SEARCH, keyWord, pageIndex, searchResults.getUserLanguage()));
+       // get the search summary
+-      var summary = copyBetween(html, '<div id="search-num-results" class="name">', '</div>');
++      var summary = copyBetween(html, HTML_SEARCH_SUMMARY_START, HTML_SEARCH_SUMMARY_END);
+       searchResults.setSummary(cleanSummary(summary));
+       // get results html block
+       var htmlResults = copyBetween(html, HTML_SEARCH_START, HTML_SEARCH_FINISH);
+@@ -148,14 +221,17 @@
+       var tmp, videoUrl, imageUrl, title, description, duration, rating;
+       // get video url
+       videoUrl = VIDEO_URL + copyBetween(html, 'href="', '"');
+-      // get title and image url
++      // get image url
+       tmp = copyBetween(html, '<img', '>') ;
+-      title = copyBetween(tmp, 'title="', '"');
+       imageUrl = copyBetween(tmp, 'src="', '"');
+       if (strIndexOf(imageUrl, "default.jpg") == -1) // if is not a "default.jpg"...
+               imageUrl = copyBetween(tmp, 'thumb="', '"');
++      imageUrl = "http:" + imageUrl;
++      // get video title
++      title = copyBetween(html, 'dir="ltr" title="', '"');
+       // get video description
+-      description = copyBetween(html, 'class="video-description">', '</div>');
++      description = copyBetween(html, '<p id="video-description-', '</p>');
++      description = copyBetween(description + '|', '>', '|');
+       // get video duration
+       duration = convertToSeconds(copyBetween(html, '<span class="video-time">', '</span>'));
+       // get rating
diff --git a/media-video/xvideoservicethief/xvideoservicethief-2.4.1-r1.ebuild b/media-video/xvideoservicethief/xvideoservicethief-2.4.1-r1.ebuild
new file mode 100644 (file)
index 0000000..5e58578
--- /dev/null
@@ -0,0 +1,81 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/xvideoservicethief/xvideoservicethief-2.4.1-r1.ebuild,v 1.1 2011/08/14 13:11:31 hwoarang Exp $
+
+EAPI=2
+
+LANGS="br ca cs da de es fr gl hu it ja ko nl pl ro ru sv"
+
+inherit eutils qt4-r2 versionator
+
+MY_PV=$(replace_all_version_separators '_')
+MY_P="xVST_${MY_PV}_src"
+
+DESCRIPTION="Download (and convert) videos from various Web Video Services"
+HOMEPAGE="http://xviservicethief.sourceforge.net/"
+SRC_URI="mirror://sourceforge/xviservicethief/${MY_P}.zip"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc"
+
+DEPEND="app-arch/unzip
+       >=x11-libs/qt-gui-4.5.3:4
+       >=x11-libs/qt-webkit-4.5.3:4
+       doc? ( app-doc/doxygen )"
+RDEPEND=">=x11-libs/qt-gui-4.5.3:4
+       virtual/ffmpeg
+       media-video/flvstreamer"
+
+RES_NAME="xVST"
+
+S="${WORKDIR}"
+
+src_prepare() {
+       # fix translations
+       mv "${S}"/resources/translations/${RES_NAME}_cz.ts \
+               "${S}"/resources/translations/${RES_NAME}_cs.ts ||die
+       mv "${S}"/resources/translations/${RES_NAME}_jp.ts      \
+               "${S}"/resources/translations/${RES_NAME}_ja.ts || die
+       mv "${S}"/resources/translations/${RES_NAME}_du.ts      \
+               "${S}"/resources/translations/${RES_NAME}_nl.ts || die
+       mv "${S}"/resources/translations/${RES_NAME}_kr.ts      \
+               "${S}"/resources/translations/${RES_NAME}_ko.ts || die
+       # fix plugins, language path
+       sed -i -e "s/getApplicationPath()\ +\ \"/\"\/usr\/share\/${PN}/g" \
+               "${S}"/src/options.cpp || die "failed to fix paths"
+       epatch "${FILESDIR}"/${P}-youtube-api.patch
+}
+
+src_compile() {
+       local lang=
+       emake || die "emake failed"
+       for lang in "${S}"/resources/translations/*.ts; do
+               lrelease ${lang}
+       done
+}
+
+src_install() {
+       dobin bin/xvst || die "dobin failed"
+       local dest=/usr/share/${PN}/plugins
+       dodir ${dest}
+       find resources/services -name '*.js' -exec cp -dpR {} "${D}"${dest} \;
+       newicon resources/images/InformationLogo.png xvst.png
+       make_desktop_entry /usr/bin/xvst xVideoServiceThief xvst 'Qt;AudioVideo;Video'
+       if use doc; then
+               cd "${S}/documentation/source"
+               sed -i "/OUTPUT_DIRECTORY/s:G\:.*:docs:" Doxyfile
+               doxygen Doxyfile
+               dohtml -r docs/html/* || die "dohtml failed"
+       fi
+
+       #install translations
+       insinto /usr/share/${PN}/languages/
+       local lang= tlang=
+       for lang in ${LINGUAS}; do
+               for tlang in ${LANGS}; do
+                       [[ ${lang} == ${tlang} ]] && doins "${S}"/resources/translations/xVST_${tlang}.qm
+               done
+       done
+}