Hello community, here is the log from the commit of package minitube for openSUSE:Factory checked in at 2019-12-06 12:11:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/minitube (Old) and /work/SRC/openSUSE:Factory/.minitube.new.4691 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "minitube" Fri Dec 6 12:11:57 2019 rev:14 rq:754588 version:3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/minitube/minitube.changes 2019-06-17 10:35:28.249200295 +0200 +++ /work/SRC/openSUSE:Factory/.minitube.new.4691/minitube.changes 2019-12-06 12:12:19.356026561 +0100 @@ -1,0 +2,11 @@ +Thu Dec 5 17:36:41 UTC 2019 - Carsten Ziepke <[email protected]> + +- Update to version 3.2: + * Updated translations + * Fixes to video playback + * Qt >= 5.10 is needed +- Removed minitube.changes as source to use as reference for the + fake build date, because SOURCE_DATE_EPOCH is used +- Spec cleanup + +------------------------------------------------------------------- Old: ---- minitube-3.1.tar.xz New: ---- minitube-3.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ minitube.spec ++++++ --- /var/tmp/diff_new_pack.IHU7Xg/_old 2019-12-06 12:12:21.360025588 +0100 +++ /var/tmp/diff_new_pack.IHU7Xg/_new 2019-12-06 12:12:21.364025587 +0100 @@ -17,7 +17,7 @@ Name: minitube -Version: 3.1 +Version: 3.2 Release: 0 Summary: Native YouTube Client License: GPL-3.0-or-later @@ -26,9 +26,6 @@ Source: %{name}-%{version}.tar.xz # Manpage written by Jakob Haufe <[email protected]> for the Debian project. Source1: minitube.1 -%if 0%{?suse_version} < 1500 -Source99: %{name}.changes -%endif # PATCH-FIX-OPENSUSE minitube-no-update-check.patch [email protected] -- Disable update check. Patch0: %{name}-no-update-check.patch BuildRequires: fdupes @@ -37,6 +34,7 @@ BuildRequires: libqt5-qtdeclarative-devel BuildRequires: pkgconfig BuildRequires: update-desktop-files +BuildRequires: pkgconfig(Qt5Core) >= 5.10 BuildRequires: pkgconfig(Qt5DBus) BuildRequires: pkgconfig(Qt5Network) BuildRequires: pkgconfig(Qt5Script) @@ -61,10 +59,6 @@ %setup -q %patch0 -p1 -%if 0%{?suse_version} < 1500 -SOURCE_DATE="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")" -export SOURCE_DATE_EPOCH="$(date -d "$SOURCE_DATE" '+%%s')" -%endif # Remove build time references so build-compare can do its work FAKE_BUILDDATE="$(LC_ALL=C date -u -d "@${SOURCE_DATE_EPOCH}" '+%%b %%e %%Y')" sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" src/aboutview.cpp @@ -81,16 +75,6 @@ %suse_update_desktop_file -r %{name} AudioVideo Video Player %fdupes %{buildroot}%{_datadir}/ -%if 0%{?suse_version} < 1500 -%post -%desktop_database_post -%icon_theme_cache_post - -%postun -%desktop_database_postun -%icon_theme_cache_postun -%endif - %files %license COPYING %doc AUTHORS CHANGES TODO ++++++ _service ++++++ --- /var/tmp/diff_new_pack.IHU7Xg/_old 2019-12-06 12:12:21.392025573 +0100 +++ /var/tmp/diff_new_pack.IHU7Xg/_new 2019-12-06 12:12:21.392025573 +0100 @@ -4,7 +4,7 @@ <param name="url">https://github.com/flaviotordini/minitube.git</param> <param name="filename">minitube</param> <param name="versionformat">@PARENT_TAG@</param> - <param name="revision">3.1</param> + <param name="revision">3.2</param> </service> <service mode="disabled" name="recompress"> <param name="file">*.tar</param> ++++++ minitube-3.1.tar.xz -> minitube-3.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minitube-3.1/locale/fr.ts new/minitube-3.2/locale/fr.ts --- old/minitube-3.1/locale/fr.ts 2019-06-14 15:06:12.000000000 +0200 +++ new/minitube-3.2/locale/fr.ts 2019-09-13 07:07:09.000000000 +0200 @@ -27,7 +27,7 @@ </message> <message> <source>Powered by %1</source> - <translation type="unfinished"/> + <translation>Alimenté par %1</translation> </message> <message> <source>Open-source software</source> @@ -856,7 +856,7 @@ </message> <message> <source>Switched to %1</source> - <translation type="unfinished"/> + <translation>Basculé vers %1</translation> </message> <message> <source>Unsubscribed from %1</source> @@ -905,7 +905,7 @@ <name>PickMessage</name> <message> <source>Pick a video</source> - <translation type="unfinished"/> + <translation>Choisir une vidéo</translation> </message> </context> <context> @@ -1102,7 +1102,7 @@ </message> <message> <source>&Forward</source> - <translation type="unfinished"/> + <translation>&Continuer</translation> </message> <message> <source>Forward to %1</source> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minitube-3.1/locale/hu.ts new/minitube-3.2/locale/hu.ts --- old/minitube-3.1/locale/hu.ts 2019-06-14 15:06:12.000000000 +0200 +++ new/minitube-3.2/locale/hu.ts 2019-09-13 07:07:09.000000000 +0200 @@ -27,11 +27,11 @@ </message> <message> <source>Powered by %1</source> - <translation type="unfinished"/> + <translation>%1 támogatásával</translation> </message> <message> <source>Open-source software</source> - <translation type="unfinished"/> + <translation>Nyílt forráskódú szoftver</translation> </message> <message> <source>Icon designed by %1.</source> @@ -209,17 +209,17 @@ <message> <source>K</source> <comment>K as in Kilo, i.e. thousands</comment> - <translation type="unfinished"/> + <translation>K</translation> </message> <message> <source>M</source> <comment>M stands for Millions</comment> - <translation type="unfinished"/> + <translation>M</translation> </message> <message> <source>B</source> <comment>B stands for Billions</comment> - <translation type="unfinished"/> + <translation>B</translation> </message> <message> <source>%1 views</source> @@ -674,11 +674,11 @@ </message> <message> <source>Toggle &Menu Bar</source> - <translation type="unfinished"/> + <translation>Toggle &Menu Bar</translation> </message> <message> <source>Menu</source> - <translation type="unfinished"/> + <translation>Menü</translation> </message> <message> <source>&Love %1? Rate it!</source> @@ -806,7 +806,7 @@ </message> <message> <source>You can still access the menu bar by pressing the ALT key</source> - <translation type="unfinished"/> + <translation>A menüt az ALT gomb lenyomásával továbbra is eléred</translation> </message> </context> <context> @@ -856,7 +856,7 @@ </message> <message> <source>Switched to %1</source> - <translation type="unfinished"/> + <translation>Ide váltás: %1</translation> </message> <message> <source>Unsubscribed from %1</source> @@ -905,7 +905,7 @@ <name>PickMessage</name> <message> <source>Pick a video</source> - <translation type="unfinished"/> + <translation>Válassz videót</translation> </message> </context> <context> @@ -1102,7 +1102,7 @@ </message> <message> <source>&Forward</source> - <translation type="unfinished"/> + <translation>&Előre</translation> </message> <message> <source>Forward to %1</source> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minitube-3.1/locale/ru.ts new/minitube-3.2/locale/ru.ts --- old/minitube-3.1/locale/ru.ts 2019-06-14 15:06:12.000000000 +0200 +++ new/minitube-3.2/locale/ru.ts 2019-09-13 07:07:09.000000000 +0200 @@ -27,11 +27,11 @@ </message> <message> <source>Powered by %1</source> - <translation type="unfinished"/> + <translation>При помощи %1</translation> </message> <message> <source>Open-source software</source> - <translation type="unfinished"/> + <translation>ПО с открытым исходным кодом</translation> </message> <message> <source>Icon designed by %1.</source> @@ -116,7 +116,7 @@ </message> <message numerus="yes"> <source>You have %n new video(s)</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>У вас %n новых видео()</numerusform><numerusform>У вас %n новых видео()</numerusform><numerusform>У вас %n новых видео()</numerusform><numerusform>У вас %n новых видео()</numerusform></translation> </message> </context> <context> @@ -197,11 +197,11 @@ </message> <message numerus="yes"> <source>%n hour(s) ago</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>%n час назад ()</numerusform><numerusform>%n часов назад ()</numerusform><numerusform>%n часов назад ()</numerusform><numerusform>%n час(-а, -ов) назад</numerusform></translation> </message> <message numerus="yes"> <source>%n day(s) ago</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>%n день назад</numerusform><numerusform>%n дней (-ня) назад</numerusform><numerusform>%n дней (-ня) назад</numerusform><numerusform>%n дней (-ня) назад</numerusform></translation> </message> <message numerus="yes"> <source>%n month(s) ago</source> @@ -210,17 +210,17 @@ <message> <source>K</source> <comment>K as in Kilo, i.e. thousands</comment> - <translation type="unfinished"/> + <translation>Тыс</translation> </message> <message> <source>M</source> <comment>M stands for Millions</comment> - <translation type="unfinished"/> + <translation>Млн</translation> </message> <message> <source>B</source> <comment>B stands for Billions</comment> - <translation type="unfinished"/> + <translation>Млрд</translation> </message> <message> <source>%1 views</source> @@ -675,11 +675,11 @@ </message> <message> <source>Toggle &Menu Bar</source> - <translation type="unfinished"/> + <translation>Скрыть &Меню</translation> </message> <message> <source>Menu</source> - <translation type="unfinished"/> + <translation>Меню</translation> </message> <message> <source>&Love %1? Rate it!</source> @@ -807,7 +807,7 @@ </message> <message> <source>You can still access the menu bar by pressing the ALT key</source> - <translation type="unfinished"/> + <translation>Открыть меню можно нажатием ALT</translation> </message> </context> <context> @@ -906,7 +906,7 @@ <name>PickMessage</name> <message> <source>Pick a video</source> - <translation type="unfinished"/> + <translation>Посмотреть видео</translation> </message> </context> <context> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minitube-3.1/minitube.pro new/minitube-3.2/minitube.pro --- old/minitube-3.1/minitube.pro 2019-06-14 15:06:12.000000000 +0200 +++ new/minitube-3.2/minitube.pro 2019-09-13 07:07:09.000000000 +0200 @@ -1,7 +1,7 @@ CONFIG += c++14 exceptions_off rtti_off optimize_full TEMPLATE = app -VERSION = 3.1 +VERSION = 3.2 DEFINES += APP_VERSION="$$VERSION" APP_NAME = Minitube diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minitube-3.1/src/ytvideo.cpp new/minitube-3.2/src/ytvideo.cpp --- old/minitube-3.1/src/ytvideo.cpp 2019-06-14 15:06:12.000000000 +0200 +++ new/minitube-3.2/src/ytvideo.cpp 2019-09-13 07:07:09.000000000 +0200 @@ -28,6 +28,7 @@ loadingStreamUrl = true; elIndex = 0; ageGate = false; + webPageLoaded = false; getVideoInfo(); } @@ -49,9 +50,13 @@ q.addQueryItem("sts", "1588"); url.setQuery(q); } else if (elIndex > elTypes.size() - 1) { - qWarning() << "Cannot get video info"; - loadingStreamUrl = false; - emit errorStreamUrl("Cannot get video info"); + qDebug() << "Cannot get video info"; + if (!webPageLoaded) { + // no video info file, but we can try loading the "urlmap" from the web page + loadWebPage(); + } else { + emitError("Cannot get video info"); + } return; } else { // qDebug() << "Trying el param:" << elTypes.at(elIndex) << elIndex; @@ -62,7 +67,7 @@ QObject *reply = HttpUtils::yt().get(url); connect(reply, SIGNAL(data(QByteArray)), SLOT(gotVideoInfo(QByteArray))); - connect(reply, SIGNAL(error(QString)), SLOT(errorVideoInfo(QString))); + connect(reply, SIGNAL(error(QString)), SLOT(emitError(QString))); // see you in gotVideoInfo... } @@ -87,6 +92,34 @@ qDebug() << "videoToken" << videoToken; this->videoToken = videoToken; + // get player_response + static const QRegExp playerResponseRE("&player_response=([^&]+)"); + if (playerResponseRE.indexIn(videoInfo) != -1) { + QString playerResponse = playerResponseRE.cap(1); + QByteArray playerResponseUtf8 = QByteArray::fromPercentEncoding(playerResponse.toUtf8()); + qDebug() << "player_response" << playerResponseUtf8; + QJsonDocument doc = QJsonDocument::fromJson(playerResponseUtf8); + QJsonObject obj = doc.object(); + if (obj.contains("streamingData")) { + auto parseFormats = [this](const QJsonArray &formats) { + for (const QJsonValue &format : formats) { + int itag = format["itag"].toInt(); + QString url = format["url"].toString(); + if (url.isEmpty()) { + QString cipher = format["cipher"].toString(); + QUrlQuery q(cipher); + url = q.queryItemValue("url"); + } + qDebug() << "player_response format" << itag << url; + if (!url.isEmpty()) urlMap.insert(itag, url); + } + }; + QJsonObject streamingDataObj = obj["streamingData"].toObject(); + parseFormats(streamingDataObj["formats"].toArray()); + parseFormats(streamingDataObj["adaptiveFormats"].toArray()); + } + } + // get fmt_url_map static const QRegExp fmtMapRE(JsFunctions::instance()->videoInfoFmtMapRE()); if (fmtMapRE.indexIn(videoInfo) == -1) { @@ -96,7 +129,6 @@ getVideoInfo(); return; } - QString fmtUrlMap = fmtMapRE.cap(1); // qDebug() << "got fmtUrlMap" << fmtUrlMap; fmtUrlMap = QByteArray::fromPercentEncoding(fmtUrlMap.toUtf8()); @@ -185,6 +217,7 @@ return; } + qDebug() << "available formats" << urlMap.keys(); const QVector<VideoDefinition> &definitions = VideoDefinition::getDefinitions(); int previousIndex = std::max(definitions.indexOf(definition) - 1, 0); for (; previousIndex >= 0; previousIndex--) { @@ -209,22 +242,26 @@ q.addQueryItem("has_verified", "1"); q.addQueryItem("bpctr", "9999999999"); url.setQuery(q); + + // QUrl url("https://www.youtube.com/embed/" + videoId); + qDebug() << "Loading webpage" << url; QObject *reply = HttpUtils::yt().get(url); connect(reply, SIGNAL(data(QByteArray)), SLOT(scrapeWebPage(QByteArray))); - connect(reply, SIGNAL(error(QString)), SLOT(errorVideoInfo(QString))); + connect(reply, SIGNAL(error(QString)), SLOT(emitError(QString))); // see you in scrapWebPage(QByteArray) } -void YTVideo::errorVideoInfo(const QString &message) { - loadingStreamUrl = false; +void YTVideo::emitError(const QString &message) { + qWarning() << message; emit errorStreamUrl(message); } void YTVideo::scrapeWebPage(const QByteArray &bytes) { - qDebug() << "scrapeWebPage"; + webPageLoaded = true; const QString html = QString::fromUtf8(bytes); + // qDebug() << "scrapeWebPage" << html; static const QRegExp ageGateRE(JsFunctions::instance()->ageGateRE()); if (ageGateRE.indexIn(html) != -1) { @@ -250,7 +287,7 @@ } if (fmtUrlMap.isEmpty()) { - qWarning() << "Cannot get fmtUrlMap from video page. Trying next el"; + qWarning() << "Cannot get fmtUrlMap from video page. Trying next el" << html; elIndex++; getVideoInfo(); return; @@ -273,7 +310,7 @@ */ QObject *reply = HttpUtils::yt().get(jsPlayerUrl); connect(reply, SIGNAL(data(QByteArray)), SLOT(parseJsPlayer(QByteArray))); - connect(reply, SIGNAL(error(QString)), SLOT(errorVideoInfo(QString))); + connect(reply, SIGNAL(error(QString)), SLOT(emitError(QString))); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minitube-3.1/src/ytvideo.h new/minitube-3.2/src/ytvideo.h --- old/minitube-3.1/src/ytvideo.h 2019-06-14 15:06:12.000000000 +0200 +++ new/minitube-3.2/src/ytvideo.h 2019-09-13 07:07:09.000000000 +0200 @@ -19,7 +19,7 @@ private slots: void gotVideoInfo(const QByteArray &bytes); - void errorVideoInfo(const QString &message); + void emitError(const QString &message); void scrapeWebPage(const QByteArray &bytes); void parseJsPlayer(const QByteArray &bytes); @@ -46,6 +46,7 @@ QString dashManifestUrl; QString jsPlayer; QMap<int, QString> urlMap; + bool webPageLoaded = false; }; #endif // YTVIDEO_H
