From 92723c9ba6a5553e1b136692d99f3bf76b9d5d1c Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Tue, 29 Sep 2020 10:49:53 +0200 Subject: [PATCH] New upstream version 3.6 --- minitube.pro | 3 +- src/channelaggregator.cpp | 18 ++- src/channelview.cpp | 5 +- src/mainwindow.cpp | 6 +- src/mediaview.cpp | 26 ++++ src/playlistmodel.cpp | 16 ++- src/refinesearchwidget.cpp | 9 +- src/searchparams.h | 4 +- src/standardfeedsview.cpp | 2 +- src/video.cpp | 34 ++++- src/video.h | 4 + src/videoapi.h | 4 +- src/ytchannel.cpp | 15 ++- src/ytjs/ytjs.cpp | 94 +++++++++++++ src/ytjs/ytjs.h | 115 ++++++++++++++++ src/ytjs/ytjs.pri | 18 +++ src/ytjs/ytjschannel.cpp | 50 +++++++ src/ytjs/ytjschannel.h | 28 ++++ src/ytjs/ytjschannelsource.cpp | 161 ++++++++++++++++++++++ src/ytjs/ytjschannelsource.h | 28 ++++ src/ytjs/ytjsnamfactory.cpp | 57 ++++++++ src/ytjs/ytjsnamfactory.h | 32 +++++ src/ytjs/ytjssearch.cpp | 205 +++++++++++++++++++++++++++++ src/ytjs/ytjssearch.h | 28 ++++ src/ytjs/ytjssinglevideosource.cpp | 102 ++++++++++++++ src/ytjs/ytjssinglevideosource.h | 28 ++++ src/ytjs/ytjsvideo.cpp | 85 ++++++++++++ src/ytjs/ytjsvideo.h | 22 ++++ src/ytsearch.cpp | 2 +- 29 files changed, 1175 insertions(+), 26 deletions(-) create mode 100644 src/ytjs/ytjs.cpp create mode 100644 src/ytjs/ytjs.h create mode 100644 src/ytjs/ytjs.pri create mode 100644 src/ytjs/ytjschannel.cpp create mode 100644 src/ytjs/ytjschannel.h create mode 100644 src/ytjs/ytjschannelsource.cpp create mode 100644 src/ytjs/ytjschannelsource.h create mode 100644 src/ytjs/ytjsnamfactory.cpp create mode 100644 src/ytjs/ytjsnamfactory.h create mode 100644 src/ytjs/ytjssearch.cpp create mode 100644 src/ytjs/ytjssearch.h create mode 100644 src/ytjs/ytjssinglevideosource.cpp create mode 100644 src/ytjs/ytjssinglevideosource.h create mode 100644 src/ytjs/ytjsvideo.cpp create mode 100644 src/ytjs/ytjsvideo.h diff --git a/minitube.pro b/minitube.pro index 5598e04..c07090c 100644 --- a/minitube.pro +++ b/minitube.pro @@ -1,7 +1,7 @@ CONFIG += c++17 exceptions_off rtti_off optimize_full object_parallel_to_source TEMPLATE = app -VERSION = 3.5.1 +VERSION = 3.6 DEFINES += APP_VERSION="$$VERSION" APP_NAME = Minitube @@ -42,6 +42,7 @@ include(lib/media/media.pri) include(src/qtsingleapplication/qtsingleapplication.pri) include(src/invidious/invidious.pri) +include(src/ytjs/ytjs.pri) INCLUDEPATH += $$PWD/src diff --git a/src/channelaggregator.cpp b/src/channelaggregator.cpp index 5848fa9..2fcf42b 100644 --- a/src/channelaggregator.cpp +++ b/src/channelaggregator.cpp @@ -30,8 +30,9 @@ $END_LICENSE */ #include "http.h" #include "httputils.h" -#include "videoapi.h" #include "ivchannelsource.h" +#include "videoapi.h" +#include "ytjschannelsource.h" ChannelAggregator::ChannelAggregator(QObject *parent) : QObject(parent), unwatchedCount(-1), running(false), stopped(false), currentChannel(0) { @@ -100,7 +101,15 @@ void ChannelAggregator::processNextChannel() { void ChannelAggregator::checkWebPage(YTChannel *channel) { currentChannel = channel; - QString url = "https://www.youtube.com/channel/" + channel->getChannelId() + "/videos"; + + QString channelId = channel->getChannelId(); + QString url; + if (channelId.startsWith("UC") && !channelId.contains(' ')) { + url = "https://www.youtube.com/channel/" + channelId + "/videos"; + } else { + url = "https://www.youtube.com/user/" + channelId + "/videos"; + } + QObject *reply = HttpUtils::yt().get(url); connect(reply, SIGNAL(data(QByteArray)), SLOT(parseWebPage(QByteArray))); @@ -153,6 +162,11 @@ void ChannelAggregator::reallyProcessChannel(YTChannel *channel) { connect(videoSource, SIGNAL(gotVideos(QVector