Hello community, here is the log from the commit of package smplayer for openSUSE:Factory checked in at 2019-10-31 18:18:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/smplayer (Old) and /work/SRC/openSUSE:Factory/.smplayer.new.2990 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "smplayer" Thu Oct 31 18:18:35 2019 rev:36 rq:744195 version:19.10.0 Changes: -------- --- /work/SRC/openSUSE:Factory/smplayer/smplayer.changes 2019-05-27 08:40:02.223032342 +0200 +++ /work/SRC/openSUSE:Factory/.smplayer.new.2990/smplayer.changes 2019-10-31 18:18:52.482235323 +0100 @@ -1,0 +2,7 @@ +Tue Oct 29 12:07:44 UTC 2019 - Hans-Peter Jansen <[email protected]> + +- Update to version 19.10.0: + * Fix for YouTube. + * Fix control when using mpv 0.30. + +------------------------------------------------------------------- Old: ---- smplayer-19.5.0.tar.bz2 New: ---- smplayer-19.10.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ smplayer.spec ++++++ --- /var/tmp/diff_new_pack.ZSXDCg/_old 2019-10-31 18:18:54.590237505 +0100 +++ /var/tmp/diff_new_pack.ZSXDCg/_new 2019-10-31 18:18:54.606237523 +0100 @@ -17,7 +17,7 @@ Name: smplayer -Version: 19.5.0 +Version: 19.10.0 Release: 0 Summary: Complete frontend for MPV License: GPL-2.0-or-later ++++++ smplayer-19.5.0.tar.bz2 -> smplayer-19.10.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/Changelog new/smplayer-19.10.0/Changelog --- old/smplayer-19.5.0/Changelog 2019-05-12 21:55:26.000000000 +0200 +++ new/smplayer-19.10.0/Changelog 2019-10-27 20:34:45.000000000 +0100 @@ -1,3 +1,20 @@ +Version 19.10: + +(2019-10-26) + * Fix the control problem with mpv 0.30. + * Set minimum icon size for toolbars to 8 pixels. + +(2019-09-19) + * Allow negative margins for subtitles (mplayer only). + * (Chromecast) Set overwrite_vtt to true and sub_position to 95. + +(2019-09-13) + * Fix youtube. + +(2019-07-08) + * New audio extensions: mp2, mpc, wv, shn. + + Version 19.5: (2019-05-10) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/Install.txt new/smplayer-19.10.0/Install.txt --- old/smplayer-19.5.0/Install.txt 2016-09-05 23:39:12.000000000 +0200 +++ new/smplayer-19.10.0/Install.txt 2019-08-16 23:59:15.000000000 +0200 @@ -17,7 +17,7 @@ sudo apt-get install libqt4-dev zlib1g-dev fakeroot build-essential devscripts debhelper g++ -(Packages to compile with Qt5: qtbase5-dev qt5-qmake qt5-default qtscript5-dev +(Or if you prefer to compile with Qt5: qtbase5-dev qt5-qmake qt5-default qtscript5-dev qttools5-dev-tools qtbase5-private-dev libqt5webkit5-dev) Now run ./create_deb.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/OBS/Makefile new/smplayer-19.10.0/OBS/Makefile --- old/smplayer-19.5.0/OBS/Makefile 2019-05-14 21:13:19.000000000 +0200 +++ new/smplayer-19.10.0/OBS/Makefile 2019-10-27 20:40:54.000000000 +0100 @@ -2,7 +2,7 @@ # deb packages at build.opensuse.org PACKAGE = smplayer -VERSION = 19.5.0 +VERSION = 19.10.0 #DEPENDS = debhelper (>= 5), zlib1g-dev, qtbase5-dev, qt5-qmake, qtscript5-dev, qttools5-dev-tools, qt5-default, qtbase5-private-dev DEPENDS = debhelper (>= 5), zlib1g-dev, libqt4-dev diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/Release_notes.txt new/smplayer-19.10.0/Release_notes.txt --- old/smplayer-19.5.0/Release_notes.txt 2019-05-12 21:59:12.000000000 +0200 +++ new/smplayer-19.10.0/Release_notes.txt 2019-10-27 20:34:45.000000000 +0100 @@ -1,3 +1,9 @@ +Version 19.10: + + * Fix for YouTube. + * Fix control when using mpv 0.30. + + Version 19.5: * Fix for YouTube. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/create_deb.sh new/smplayer-19.10.0/create_deb.sh --- old/smplayer-19.5.0/create_deb.sh 2019-05-14 21:13:19.000000000 +0200 +++ new/smplayer-19.10.0/create_deb.sh 2019-10-27 20:40:54.000000000 +0100 @@ -4,7 +4,7 @@ cp debian-orig/changelog-orig debian-orig/changelog ./get_svn_revision.sh -#dch -v 19.5.0-`cat svn_revision` "New version" +#dch -v 19.10.0-`cat svn_revision` "New version" #dpkg-buildpackage -rfakeroot diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/debian-orig/changelog-orig new/smplayer-19.10.0/debian-orig/changelog-orig --- old/smplayer-19.5.0/debian-orig/changelog-orig 2019-05-14 21:13:19.000000000 +0200 +++ new/smplayer-19.10.0/debian-orig/changelog-orig 2019-10-27 20:40:54.000000000 +0100 @@ -1,3 +1,10 @@ +smplayer (19.10.0) precise; urgency=low + + * Fix for YouTube. + * Fix control when using mpv 0.30. + + -- Ricardo Villalba <[email protected]> Sun, 27 Oct 2019 20:38:21 +0100 + smplayer (19.5.0) precise; urgency=low * Fix for YouTube. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/smplayer.spec new/smplayer-19.10.0/smplayer.spec --- old/smplayer-19.5.0/smplayer.spec 2019-05-14 21:13:19.000000000 +0200 +++ new/smplayer-19.10.0/smplayer.spec 2019-10-27 20:40:54.000000000 +0100 @@ -1,5 +1,5 @@ Name: smplayer -Version: 19.5.0 +Version: 19.10.0 %global smplayer_themes_ver 18.6.0 %global smplayer_skins_ver 15.2.0 #%global webfs_ver 1.21 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/chromecast.cpp new/smplayer-19.10.0/src/chromecast.cpp --- old/smplayer-19.5.0/src/chromecast.cpp 2019-01-16 23:53:28.000000000 +0100 +++ new/smplayer-19.10.0/src/chromecast.cpp 2019-09-19 21:20:11.000000000 +0200 @@ -80,8 +80,8 @@ #ifdef CONVERT_TO_VTT autoconvert_to_vtt = true; sub_encoding = "ISO-8859-1"; - sub_position = -1; - overwrite_vtt = false; + sub_position = 95; + overwrite_vtt = true; use_sub_filter = true; #endif @@ -416,7 +416,7 @@ settings->beginGroup("chromecast/subtitles"); setAutoConvertToVTT(settings->value("autoconvert_to_vtt", autoConvertToVTT()).toBool()); //setSubtitleEncoding(settings->value("encoding", subtitleEncoding()).toString()); - setSubtitlePosition(settings->value("position", -1).toInt()); + setSubtitlePosition(settings->value("position", subtitlePosition()).toInt()); setSubtitleFilter(settings->value("text_filter", subtitleFilter()).toString()); setOverwriteVTT(settings->value("overwrite_vtt", overwriteVTT()).toBool()); enableSubtitleFilter(settings->value("use_sub_filter", isSubtitleFilterEnabled()).toBool()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/core.cpp new/smplayer-19.10.0/src/core.cpp --- old/smplayer-19.5.0/src/core.cpp 2019-02-25 21:45:52.000000000 +0100 +++ new/smplayer-19.10.0/src/core.cpp 2019-07-04 21:07:14.000000000 +0200 @@ -289,7 +289,6 @@ #ifdef YOUTUBE_SUPPORT yt = new RetrieveYoutubeUrl(this); yt->setUseHttpsMain(pref->yt_use_https_main); - yt->setUseHttpsVi(pref->yt_use_https_vi); #ifdef YT_USE_SIG QSettings * sigset = new QSettings(Paths::configPath() + "/sig.ini", QSettings::IniFormat, this); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/extensions.cpp new/smplayer-19.10.0/src/extensions.cpp --- old/smplayer-19.5.0/src/extensions.cpp 2019-01-16 23:53:28.000000000 +0100 +++ new/smplayer-19.10.0/src/extensions.cpp 2019-07-08 21:45:32.000000000 +0200 @@ -66,8 +66,9 @@ << "bik" << "smk" << "m4b" << "wtv" << "part"; - _audio << "mp3" << "ogg" << "oga" << "wav" << "wma" << "aac" << "ac3" - << "dts" << "ra" << "ape" << "flac" << "thd" << "mka" << "m4a" << "opus"; + _audio << "mp2" << "mp3" << "mpc" << "ogg" << "oga" << "wav" << "wma" << "aac" + << "ac3" << "dts" << "ra" << "ape" << "flac" << "thd" << "mka" << "m4a" + << "wv" << "shn" << "opus"; _subtitles << "srt" << "sub" << "ssa" << "ass" << "idx" << "txt" << "smi" << "rt" << "utf" << "aqt" << "vtt"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/mpvoptions.cpp new/smplayer-19.10.0/src/mpvoptions.cpp --- old/smplayer-19.5.0/src/mpvoptions.cpp 2019-01-16 23:53:28.000000000 +0100 +++ new/smplayer-19.10.0/src/mpvoptions.cpp 2019-10-26 21:49:32.000000000 +0200 @@ -63,7 +63,8 @@ arg << "--term-playing-msg=" "MPV_VERSION=${=mpv-version:}\n" "INFO_VIDEO_WIDTH=${=width}\nINFO_VIDEO_HEIGHT=${=height}\n" - "INFO_VIDEO_ASPECT=${=video-aspect}\n" +// "INFO_VIDEO_ASPECT=${=video-aspect}\n" // old + "INFO_VIDEO_ASPECT=${=video-params/aspect}\n" // "INFO_VIDEO_DSIZE=${=dwidth}x${=dheight}\n" "INFO_VIDEO_FPS=${=container-fps:${=fps}}\n" // "INFO_VIDEO_BITRATE=${=video-bitrate}\n" @@ -200,7 +201,12 @@ if (option_name == "cache") { int cache = value.toInt(); if (cache > 31) { - arg << "--cache=" + value.toString(); + if (isOptionAvailable("--demuxer-max-bytes")) { + int bytes = value.toString().toInt() * 1024; + arg << "--demuxer-max-bytes=" + QString::number(bytes); + } else { + arg << "--cache=" + value.toString(); + } } else { arg << "--cache=no"; } @@ -1184,6 +1190,13 @@ SUBOPTION(sub_align_x, "--sub-align-x", "--sub-text-align-x"); SUBOPTION(sub_align_y, "--sub-align-y", "--sub-text-align-y"); + QString sub_margin_y = ""; + if (isOptionAvailable("--sub-margin-y")) sub_margin_y = "--sub-margin-y"; + + QString sub_margin_x = ""; + if (isOptionAvailable("--sub-margin-x")) sub_margin_x = "--sub-margin-x"; + + if (!sub_font.isEmpty()) { QString font = styles.fontname; //arg << "--sub-text-font=" + font.replace(" ", ""); @@ -1239,10 +1252,22 @@ if (!sub_align_x.isEmpty() && !halign.isEmpty()) { arg << sub_align_x + "=" + halign; } - + if (!sub_align_y.isEmpty() && !valign.isEmpty()) { arg << sub_align_y + "=" + valign; } + + if (!sub_margin_y.isEmpty()) { + int marginv = styles.marginv; + if (marginv < 0) marginv = 0; + arg << sub_margin_y + "=" + QString::number(marginv); + } + + if (!sub_margin_x.isEmpty()) { + int marginx = styles.marginl; + if (marginx < 0) marginx = 0; + arg << sub_margin_x + "=" + QString::number(marginx); + } } void MPVProcess::setChannelsFile(const QString & filename) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/mpvprocess.cpp new/smplayer-19.10.0/src/mpvprocess.cpp --- old/smplayer-19.5.0/src/mpvprocess.cpp 2019-01-16 23:53:28.000000000 +0100 +++ new/smplayer-19.10.0/src/mpvprocess.cpp 2019-10-26 21:39:15.000000000 +0200 @@ -122,9 +122,9 @@ void MPVProcess::initializeRX() { #ifdef CUSTOM_STATUS - rx_av.setPattern("^STATUS: ([0-9\\.-]+) / ([0-9\\.-]+) P: (yes|no) B: (yes|no) I: (yes|no) VB: ([0-9\\.-]+) AB: ([0-9\\.-]+)"); + rx_av.setPattern("STATUS: ([0-9\\.-]+) / ([0-9\\.-]+) P: (yes|no) B: (yes|no) I: (yes|no) VB: ([0-9\\.-]+) AB: ([0-9\\.-]+)"); #else - rx_av.setPattern("^(\\((.*)\\) |)(AV|V|A): ([0-9]+):([0-9]+):([0-9]+) / ([0-9]+):([0-9]+):([0-9]+)"); //AV: 00:02:15 / 00:09:56 + rx_av.setPattern("(\\((.*)\\) |)(AV|V|A): ([0-9]+):([0-9]+):([0-9]+) / ([0-9]+):([0-9]+):([0-9]+)"); //AV: 00:02:15 / 00:09:56 #endif rx_dsize.setPattern("^INFO_VIDEO_DSIZE=(\\d+)x(\\d+)"); @@ -197,7 +197,7 @@ static double last_sec = -1; // Parse A: V: line - //qDebug("MPVProcess::parseLine: %s", line.toUtf8().data()); + //qDebug() << "MPVProcess::parseLine:" << line; if (rx_av.indexIn(line) > -1) { #ifdef CUSTOM_STATUS double sec = rx_av.cap(1).toDouble(); @@ -273,7 +273,9 @@ double length = h * 3600 + m * 60 + s; if (length != md.duration) { md.duration = length; + #if DVDNAV_SUPPORT emit receivedDuration(length); + #endif } if (status == "Paused") { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/preferences.cpp new/smplayer-19.10.0/src/preferences.cpp --- old/smplayer-19.5.0/src/preferences.cpp 2019-01-26 20:51:53.000000000 +0100 +++ new/smplayer-19.10.0/src/preferences.cpp 2019-07-04 21:07:14.000000000 +0200 @@ -546,7 +546,6 @@ yt_user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:5.0.1) Gecko/20100101 Firefox/5.0.1"; //yt_user_agent = ""; yt_use_https_main = false; - yt_use_https_vi = false; yt_use_dash = false; yt_use_60fps = true; #endif @@ -1099,7 +1098,6 @@ set->setValue("resolution", yt_resolution); set->setValue("yt_user_agent", yt_user_agent); set->setValue("yt_use_https_main", yt_use_https_main); - set->setValue("yt_use_https_vi", yt_use_https_vi); set->setValue("use_dash", yt_use_dash); set->setValue("use_60fps", yt_use_60fps); set->endGroup(); @@ -1700,7 +1698,6 @@ yt_resolution = set->value("resolution", yt_resolution).toInt(); yt_user_agent = set->value("yt_user_agent", yt_user_agent).toString(); yt_use_https_main = set->value("yt_use_https_main", yt_use_https_main).toBool(); - yt_use_https_vi = set->value("yt_use_https_vi", yt_use_https_vi).toBool(); yt_use_dash = set->value("use_dash", yt_use_dash).toBool(); yt_use_60fps = set->value("use_60fps", yt_use_60fps).toBool(); set->endGroup(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/preferences.h new/smplayer-19.10.0/src/preferences.h --- old/smplayer-19.5.0/src/preferences.h 2019-01-26 20:51:53.000000000 +0100 +++ new/smplayer-19.10.0/src/preferences.h 2019-07-04 21:07:14.000000000 +0200 @@ -519,7 +519,6 @@ int yt_resolution; QString yt_user_agent; bool yt_use_https_main; - bool yt_use_https_vi; bool yt_use_dash; bool yt_use_60fps; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/prefsubtitles.ui new/smplayer-19.10.0/src/prefsubtitles.ui --- old/smplayer-19.5.0/src/prefsubtitles.ui 2018-02-05 22:31:06.000000000 +0100 +++ new/smplayer-19.10.0/src/prefsubtitles.ui 2019-09-19 20:58:53.000000000 +0200 @@ -6,7 +6,7 @@ <rect> <x>0</x> <y>0</y> - <width>541</width> + <width>613</width> <height>439</height> </rect> </property> @@ -551,7 +551,11 @@ </widget> </item> <item row="0" column="1"> - <widget class="QSpinBox" name="style_marginl_spin"/> + <widget class="QSpinBox" name="style_marginl_spin"> + <property name="minimum"> + <number>-99</number> + </property> + </widget> </item> <item row="0" column="2"> <widget class="QLabel" name="label_8"> @@ -567,7 +571,11 @@ </widget> </item> <item row="0" column="3"> - <widget class="QSpinBox" name="style_marginr_spin"/> + <widget class="QSpinBox" name="style_marginr_spin"> + <property name="minimum"> + <number>-99</number> + </property> + </widget> </item> <item row="1" column="0"> <widget class="QLabel" name="label_9"> @@ -583,7 +591,11 @@ </widget> </item> <item row="1" column="1"> - <widget class="QSpinBox" name="style_marginv_spin"/> + <widget class="QSpinBox" name="style_marginv_spin"> + <property name="minimum"> + <number>-99</number> + </property> + </widget> </item> <item row="1" column="2" colspan="2"> <spacer> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/smplayer.rc new/smplayer-19.10.0/src/smplayer.rc --- old/smplayer-19.5.0/src/smplayer.rc 2019-05-14 21:13:19.000000000 +0200 +++ new/smplayer-19.10.0/src/smplayer.rc 2019-10-27 20:40:54.000000000 +0100 @@ -1,7 +1,7 @@ #include <winver.h> -#define SMPLAYER_FILEVERSION 19,5,0,0 -#define SMPLAYER_PRODVERSION "19.5.0.0" +#define SMPLAYER_FILEVERSION 19,10,0,0 +#define SMPLAYER_PRODVERSION "19.10.0.0" VS_VERSION_INFO VERSIONINFO FILEVERSION SMPLAYER_FILEVERSION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/toolbareditor.ui new/smplayer-19.10.0/src/toolbareditor.ui --- old/smplayer-19.5.0/src/toolbareditor.ui 2015-02-08 02:47:55.000000000 +0100 +++ new/smplayer-19.10.0/src/toolbareditor.ui 2019-10-27 00:02:26.000000000 +0200 @@ -137,7 +137,7 @@ <item> <widget class="QSpinBox" name="iconsize_spin"> <property name="minimum"> - <number>24</number> + <number>8</number> </property> <property name="maximum"> <number>256</number> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/version.cpp new/smplayer-19.10.0/src/version.cpp --- old/smplayer-19.5.0/src/version.cpp 2019-05-14 21:13:19.000000000 +0200 +++ new/smplayer-19.10.0/src/version.cpp 2019-10-27 20:40:54.000000000 +0100 @@ -22,12 +22,12 @@ #define USE_SVN_VERSIONS 1 #define DEVELOPMENT_VERSION 0 -#define VERSION "19.5.0" +#define VERSION "19.10.0" #if USE_SVN_VERSIONS && DEVELOPMENT_VERSION #include "svn_revision.h" #else -#define SVN_REVISION "9214" +#define SVN_REVISION "9238" #endif #ifdef Q_OS_WIN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/youtube/retrieveyoutubeurl.cpp new/smplayer-19.10.0/src/youtube/retrieveyoutubeurl.cpp --- old/smplayer-19.5.0/src/youtube/retrieveyoutubeurl.cpp 2019-05-12 00:32:20.000000000 +0200 +++ new/smplayer-19.10.0/src/youtube/retrieveyoutubeurl.cpp 2019-09-13 21:53:55.000000000 +0200 @@ -43,6 +43,8 @@ #endif #endif +#define SUPPORT_OLD_FORMAT + RetrieveYoutubeUrl::RetrieveYoutubeUrl(QObject* parent) : QObject(parent) @@ -51,7 +53,6 @@ #endif , preferred_resolution(R720p) , use_https_main(false) - , use_https_vi(false) #ifdef YT_DASH_SUPPORT , use_dash(false) , use_60fps(false) @@ -216,8 +217,7 @@ void RetrieveYoutubeUrl::fetchVideoInfoPage(const QString & url) { QString video_id = getVideoID(url); - QString scheme = use_https_vi ? "https" : "http"; - QString u = QString("%2://www.youtube.com/get_video_info?video_id=%1&disable_polymer=true&eurl=https://youtube.googleapis.com/v/%1&gl=US&hl=en").arg(video_id).arg(scheme); + QString u = QString("https://www.youtube.com/get_video_info?video_id=%1&disable_polymer=true&eurl=https://youtube.googleapis.com/v/%1&gl=US&hl=en").arg(video_id); qDebug() << "RetrieveYoutubeUrl::fetchVideoInfoPage: url:" << u; if (u.toLower().startsWith("https") && !QSslSocket::supportsSsl()) { @@ -349,6 +349,7 @@ #endif QString fmtArray; +#ifdef SUPPORT_OLD_FORMAT QRegExp regex("\\\"url_encoded_fmt_stream_map\\\"\\s*:\\s*\\\"([^\\\"]*)"); if (regex.indexIn(replyString) != -1) { fmtArray = regex.cap(1); @@ -361,6 +362,9 @@ fmtArray += regex2.cap(1); } #endif +#endif + + if (fmtArray.isEmpty()) fmtArray = getArrayFromStreamingData(replyString); fmtArray = sanitizeForUnicodePoint(fmtArray); fmtArray.replace(QRegExp("\\\\(.)"), "\\1"); @@ -385,10 +389,58 @@ #endif } +QString RetrieveYoutubeUrl::getArrayFromStreamingData(const QString & page) { + qDebug("RetrieveYoutubeUrl::getArrayFromStreamingData"); + + QString fmtArray; + + QStringList exps; + exps << "streamingData.*formats\\\\\":\\[(.*)\\]"; + #ifdef YT_DASH_SUPPORT + exps << "streamingData.*adaptiveFormats\\\\\":\\[(.*)\\]"; + #endif + + foreach(QString expression, exps) { + QString text; + QRegExp rx_block(expression); + rx_block.setMinimal(true); + if (rx_block.indexIn(page) != -1) { + text = rx_block.cap(1); + //qDebug() << "text:" << text; + + QRegExp regex("(cipher|url)\\\\\":\\\\\"(.*)\\\\\""); + regex.setMinimal(true); + + int pos = 0; + while ((pos = regex.indexIn(text, pos)) != -1) { + if (!fmtArray.isEmpty()) fmtArray += ","; + if (regex.cap(1) == "url") { + QString url = regex.cap(2); + url = QUrl::fromPercentEncoding(url.toUtf8()); + url = sanitizeForUnicodePoint(url); + url.replace(QRegExp("\\\\(.)"), "\\1"); + url = QUrl::toPercentEncoding(url); + fmtArray += "url="; + fmtArray += url; + } else { + fmtArray += regex.cap(2); + } + pos += regex.matchedLength(); + } + } + } + + //qDebug() << "RetrieveYoutubeUrl::getArrayFromStreamingData: fmtArray:" << fmtArray; + return fmtArray; +} + #ifdef YT_GET_VIDEOINFO void RetrieveYoutubeUrl::videoInfoPageLoaded(QByteArray page) { qDebug() << "RetrieveYoutubeUrl::videoInfoPageLoaded"; + QByteArray fmtArray; + +#ifdef SUPPORT_OLD_FORMAT #if QT_VERSION >= 0x050000 QUrlQuery all; all.setQuery(page); @@ -397,7 +449,6 @@ all.setEncodedQuery(page); #endif - QByteArray fmtArray; #if QT_VERSION >= 0x050000 fmtArray = all.queryItemValue("url_encoded_fmt_stream_map", QUrl::FullyDecoded).toLatin1(); #else @@ -412,6 +463,14 @@ fmtArray += all.queryItemValue("adaptive_fmts").toLatin1(); #endif #endif +#endif + + if (fmtArray.isEmpty()) { + QString s = QUrl::fromPercentEncoding(page); + s = sanitizeForUnicodePoint(s); + s.replace("\"", "\\\""); + fmtArray = getArrayFromStreamingData(s).toLatin1(); + } //qDebug() <<"RetrieveYoutubeUrl::videoInfoPageLoaded: fmtArray:" << fmtArray; @@ -655,6 +714,11 @@ qDebug() << "RetrieveYoutubeUrl::extractURLs: discarted url with empty clen"; continue; } + } else { + if (!q->hasQueryItem("clen")) { + qDebug() << "RetrieveYoutubeUrl::extractURLs: discarted url with no clen"; + continue; + } } if ((q->hasQueryItem("itag")) /*&& (q->hasQueryItem(signature_name))*/) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smplayer-19.5.0/src/youtube/retrieveyoutubeurl.h new/smplayer-19.10.0/src/youtube/retrieveyoutubeurl.h --- old/smplayer-19.5.0/src/youtube/retrieveyoutubeurl.h 2019-05-12 00:32:20.000000000 +0200 +++ new/smplayer-19.10.0/src/youtube/retrieveyoutubeurl.h 2019-09-13 21:53:55.000000000 +0200 @@ -139,9 +139,7 @@ QString fullUrl(const QString & url); void setUseHttpsMain(bool b) { use_https_main = b; }; - void setUseHttpsVi(bool b) { use_https_vi = b; }; bool useHttpsMain() { return use_https_main; }; - bool useHttpsVi() { return use_https_vi; }; static QString extensionForItag(int itag); @@ -188,6 +186,7 @@ QString getVideoID(QString video_url); OptMap extractOptions(const QByteArray & urldata); + QString getArrayFromStreamingData(const QString & page); UrlMap extractURLs(QString fmtArray, bool allow_https, bool use_player); void finish(const UrlMap & url_map); @@ -225,7 +224,6 @@ Resolution preferred_resolution; bool use_https_main; - bool use_https_vi; QString yt_url; QString url_title;
