Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix update detection by using requests library over urllib #649

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions kindlecomicconverter/KCC_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@
# OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
import json
import os
import re
import subprocess
import sys
from urllib.parse import unquote
from urllib.request import urlretrieve, urlopen
from time import sleep
from shutil import move, rmtree
from subprocess import STDOUT, PIPE

import requests
# noinspection PyUnresolvedReferences
from PyQt5 import QtGui, QtCore, QtWidgets, QtNetwork
from xml.sax.saxutils import escape
Expand Down Expand Up @@ -139,10 +138,7 @@ def __del__(self):

def run(self):
try:
last_version_url = urlopen("https://api.github.com/repos/ciromattia/kcc/releases/latest")
data = last_version_url.read()
encoding = last_version_url.info().get_content_charset('utf-8')
json_parser = json.loads(data.decode(encoding))
json_parser = requests.get("https://api.github.com/repos/ciromattia/kcc/releases/latest").json()

html_url = json_parser["html_url"]
latest_version = json_parser["tag_name"]
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PyQt5>=5.6.0
Pillow>=5.2.0
psutil>=5.0.0
requests>=2.31.0
python-slugify>=1.2.1
raven>=6.0.0
# PyQt5-tools
Expand Down