commit 4a01cd8f2a592a2d651659d9668b8daccc7f1eaf
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Mon Nov 1 15:22:22 2021 +0000
add fixes from upstream, rfbz #6161
65_64.diff | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66_65.diff | 92 +++++++++++++++++++++++++++++++++++
qarte.spec | 10 +++-
3 files changed, 262 insertions(+), 2 deletions(-)
---
diff --git a/65_64.diff b/65_64.diff
new file mode 100644
index 0000000..2f9037d
--- /dev/null
+++ b/65_64.diff
@@ -0,0 +1,162 @@
+=== modified file 'arteconcert.py'
+--- arteconcert.py 2021-08-23 08:57:52 +0000
++++ arteconcert.py 2021-11-01 08:04:48 +0000
+@@ -295,10 +295,13 @@
+ # Quick method first
+ idx = item.order
+ #https://www.w3schools.com/tags/ref_urlencode.asp
++ #url = "".join(["https://api.arte.tv/api/",
++ #"player/v1/config/{0}/{1}?autostart=1&",
++ #"lifeCycle=1&lang={2}_{3}"])
+ url = "".join(["https://api.arte.tv/api/",
+- "player/v1/config/{0}/{1}?autostart=1&",
+- "lifeCycle=1&lang={2}_{3}"])
+- url = url.format(self.lang, idx, self.lang, self.lang.upper())
++ "player/v1/config/{0}/{1}"])
++ url = url.format(self.lang, idx)
++ #url = url.format(self.lang, idx, self.lang, self.lang.upper())
+ item.jsonurl = url
+ content = self.get_page(url)
+
+
+=== modified file 'artetv.py'
+--- artetv.py 2021-08-23 08:02:22 +0000
++++ artetv.py 2021-11-01 08:04:48 +0000
+@@ -466,6 +466,7 @@
+ lgg.info("Download item page: %s" % item.url)
+ if item.url.startswith(("/fr/", "/de/")):
+ item.url = "https://www.arte.tv" + item.url
++
+ desc, origin, anno, duration, rea, country = '', '', '',
'', '', ''
+ page = self.get_page_content(item.url)
+
+@@ -484,33 +485,44 @@
+ short = video.get("shortDescription", "")
+ if short is None:
+ short = ""
++
+ desc = video.get("fullDescription", "")
+ if desc is None:
+ desc = ''
++
+ item.description = "%s<br/>%s" %(short, desc)
+ try:
+ item.label = video["kind"].get("label",
"parsed")
+ except KeyError:
+ item.label = "parsed"
++
+ item.duration = self.format_duration(video.get("duration", 0))
+- credits = video["credits"]
+- for credit in credits:
+- code = credit["code"]
+- if code == "REA":
+- item.realisation = credit["values"]
+- elif code == "ACT":
+- item.actors = credit["values"]
+- elif code == "MUS":
+- item.music = credit["values"]
+- elif code == "COUNTRY":
+- item.origin = ", ".join(credit["values"])
+- elif code == "PRODUCTION_YEAR":
+- if credit["values"]:
+- item.anno = credit["values"][0]
++ try:
++ credits = video["credits"]
++ except:
++ pass
++ else:
++ for credit in credits:
++ code = credit["code"]
++ if code == "REA":
++ item.realisation = credit["values"]
++
++ elif code == "ACT":
++ item.actors = credit["values"]
++
++ elif code == "MUS":
++ item.music = credit["values"]
++
++ elif code == "COUNTRY":
++ item.origin = ", ".join(credit["values"])
++
++ elif code == "PRODUCTION_YEAR":
++ if credit["values"]:
++ item.anno = credit["values"][0]
++
+ if not item.description:
+ item.description = item.teaser
+
+-
+ def format_duration(self, value):
+ if value is not None:
+ min_, sec = divmod(value, 60)
+@@ -589,6 +601,17 @@
+ return str(content.read().decode('utf-8', 'replace'))
+ except Exception as why:
+ lgg.info('HTTP error: %s, %s' % (url, why))
++ if "#" in url:
++ url = url.replace("#", "/#")
++ req = urllib.request.Request(url, data=None,
++ headers={"User-Agent": user_agent})
++ lgg.info("Try with: %s" % url)
++ try:
++ content = urllib.request.urlopen(req)
++ return str(content.read().decode('utf-8',
'replace'))
++ except Exception as why:
++ lgg.info('HTTP error: %s, %s' % (url, why))
++
+ return False
+
+ def load_image(self, item):
+@@ -604,6 +627,7 @@
+ with open(path, 'wb') as objfile:
+ f = urllib.request.urlopen(item.pix_url, timeout=5)
+ objfile.write(f.read())
++
+ return path
+ except Exception as why:
+ lgg.info("Can't load image: %s" % item.pix_url)
+@@ -617,6 +641,7 @@
+ with open(fname, 'wb') as objfile:
+ f = urllib.request.urlopen(url, timeout=5)
+ objfile.write(f.read())
++
+ return fname
+ except Exception as why:
+ lgg.info("Can't load image: %s" % url)
+@@ -708,6 +733,7 @@
+ def remove_old_videos(self):
+ def remove():
+ self.clean_thumbnails()
++
+ Thread(target=remove).start()
+
+ def clean_thumbnails(self):
+@@ -775,9 +801,11 @@
+ def edit_category_data(self, title, subtitle, teaser):
+ if not title.endswith("\n"):
+ title += "\n"
++
+ if subtitle is not None:
+ if not subtitle.endswith("\n"):
+ subtitle += "\n"
++
+ else:
+ subtitle = ""
+ self.ui.pitch_editor.clear()
+
+=== modified file 'gui/mainui.py'
+--- gui/mainui.py 2020-10-15 09:33:01 +0000
++++ gui/mainui.py 2021-11-01 08:04:48 +0000
+@@ -471,8 +471,8 @@
+ if img.isNull():
+ img = QPixmap("medias/noPreview.png").scaled(QSize(180, 102))
+
+- w = float(QSize.width(img.size()))
+- h = float(QSize.height(img.size()))
++ w = QSize.width(img.size())
++ h = QSize.height(img.size())
+ # white frame
+ brect = QRect(0, 0, w+3, h+3)
+ bckgrnd = back.scaled(QSize(w+25, h+25))
+
diff --git a/66_65.diff b/66_65.diff
new file mode 100644
index 0000000..ec7b7c8
--- /dev/null
+++ b/66_65.diff
@@ -0,0 +1,92 @@
+=== modified file 'artetv.py'
+--- artetv.py 2021-11-01 08:04:48 +0000
++++ artetv.py 2021-11-01 09:33:11 +0000
+@@ -74,6 +74,7 @@
+ self.categories = []
+ self.categories_videos = {}
+ self.culture_at_home = {}
++ self.current_category = "arte+7"
+ self.is_in_category = False
+ self.is_loading = False
+ self.loading_aborted = False
+@@ -134,6 +135,7 @@
+ if is_videos:
+ self.ui.categories_cmb.currentTextChanged.connect(
+ self.change_category)
++ self.ui.refresh_btn.clicked.connect(self.reload_category)
+
+ self.remove_old_videos()
+
+@@ -203,6 +205,10 @@
+
+ self.is_in_category = True
+ self.ui.arte_list.display_category(selection)
++ self.current_category = name
++
++ def reload_category(self):
++ self.change_category(self.current_category)
+
+ def display_category_content(self, idx):
+ cat = self.ui.arte_list.video_items[idx]
+@@ -213,6 +219,7 @@
+
+ else:
+ self.display_sub_category(cat)
++ self.ui.refresh_btn.setEnabled(True)
+
+ def display_sub_category(self, category):
+ url = category.item.url
+
+=== modified file 'data.py'
+--- data.py 2021-08-23 08:02:22 +0000
++++ data.py 2021-11-01 09:33:11 +0000
+@@ -11,7 +11,7 @@
+ # Constants list, XXX don't forget to update VERSION if needed.
+
+
+-VERSION = (4, 14, 0)
++VERSION = (4, 15, 0)
+
+ VERSION_STR = '.'.join(str(i) for i in VERSION)
+
+
+=== modified file 'gui/mainui.py'
+--- gui/mainui.py 2021-11-01 08:04:48 +0000
++++ gui/mainui.py 2021-11-01 09:33:11 +0000
+@@ -96,6 +96,13 @@
+ self.categories_cmb = QComboBox(self)
+ self.categories_cmb.setMinimumSize(200, 24)
+ self.hl_2.addWidget(self.categories_cmb)
++ self.refresh_btn = QToolButton(self.widget1)
++ icon2 = QIcon()
++ icon2.addPixmap(QPixmap("medias/refresh.png"))
++ self.refresh_btn.setIcon(icon2)
++ self.refresh_btn.setIconSize(QSize(20, 20))
++ self.refresh_btn.setEnabled(False)
++ self.hl_2.addWidget(self.refresh_btn)
+ spacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
+ self.hl_2.addItem(spacer)
+ self.sizer_wdg = HorizontalSlider(self.widget1)
+
+=== modified file 'qarte'
+--- qarte 2021-08-23 08:57:52 +0000
++++ qarte 2021-11-01 09:33:11 +0000
+@@ -5,7 +5,7 @@
+ # This file is part of qarte-4
+ #
+ # Author: Vincent Vande Vyvre <vincent.vandevyvre(a)oqapy.eu>
+-# Copyright: 2011-2020 Vincent Vande Vyvre
++# Copyright: 2011-2021 Vincent Vande Vyvre
+ # Licence: GPL3
+ # Home page:
https://launchpad.net/qarte
+ #
+@@ -31,7 +31,7 @@
+ import platform
+ import locale
+
+-VERSION_STR = "4.14.0"
++VERSION_STR = "4.15.0"
+
+ from PyQt5.QtWidgets import QApplication
+
+
diff --git a/qarte.spec b/qarte.spec
index 5a28531..b656f73 100644
--- a/qarte.spec
+++ b/qarte.spec
@@ -3,7 +3,7 @@
Name: qarte
Version: 4.14.0
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv3+
URL:
https://launchpad.net/qarte
Source0:
http://oqapy.eu/releases/%{name}-%{version}.tar.gz
@@ -15,13 +15,16 @@ BuildRequires: python3-devel
Requires: rtmpdump
Requires: python3-qt5
BuildArch: noarch
+Patch1: 65_64.diff
+Patch2: 66_65.diff
+
%description
Qarte allows browsing the archive of arte+7 & arteLiveWeb sites
and recording videos.
%prep
-%setup -q
+%autosetup -p0
%build
@@ -48,6 +51,9 @@ cp -pR locale %{buildroot}%{_datadir}
%{_datadir}/icons/hicolor/96x96/apps/%{name}.png
%changelog
+* Mon Nov 01 2021 Sérgio Basto <sergio(a)serjux.com> - 4.14.0-2
+- add fixes from upstream, rfbz #6161
+
* Sat Sep 04 2021 Sérgio Basto <sergio(a)serjux.com> - 4.14.0-1
- Update to 4.14.0 rfbz #6060