XaF / TraktForVLC

Automatically trakt.tv what you're watching on VLC
300 stars 49 forks source link

requests.exceptions.SSLError #87

Closed adrian70000 closed 6 years ago

adrian70000 commented 6 years ago

Hi,

OS x version: 10.12.6 Python: 2.7.9

When trying to start the TraktForVLC.py I get this error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/XaF/TraktForVLC/releases (Caused by SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:581)'),))

If I delete the following part of the script then it starts but the PIN never changes into anything:

# Check if there's a newer version of TraktForVLC on the project's github,
# and print informations on that subject in the logs
def __check_version(self):
    # The leading information for lines printed by this method in logs
    lead = "VERSION:"

    # Request the github API to get the releases information
    github_releases = requests.get(
        url="https://api.github.com/repos/XaF/TraktForVLC/releases")

    # If there was a problem getting the releases
    if not github_releases.ok:
        self.log.error(lead +
                       "Unable to verify new releases of TraktForVLC")
        return

    # Else, we get the json answer
    releases = github_releases.json()

    # If we didn't find any release
    if not releases:
        self.log.warning(lead +
                         "No releases found on github")
        return

    # We get the latest release, all included
    newest = sorted(
        releases,
        key=lambda x: x['tag_name'],
        reverse=True)[0]
    if newest['tag_name'][:1] == "v":
        newest['tag_name'] = newest['tag_name'][1:]
    newest_V = parse_version(newest['tag_name'])

    # We get the latest _stable_ release
    newest_stbl = sorted(
        [r for r in releases if not r['prerelease']],
        key=lambda x: x['tag_name'],
        reverse=True)[0]
    if newest_stbl['tag_name'][:1] == "v":
        newest_stbl['tag_name'] = newest_stbl['tag_name'][1:]
    newest_stbl_V = parse_version(newest_stbl['tag_name'])

    # We parse the current version
    current_V = parse_version(__version__)

    if newest_V <= current_V:
        self.log.info(lead + "TraktForVLC is up to date")
        return

    # We only show the latest stable release if
    # it's newer than our current release
    if newest_stbl_V > current_V:
        # We reformat the publication date of the release
        published = datetime.datetime.strptime(
            newest_stbl['published_at'],
            "%Y-%m-%dT%H:%M:%SZ").strftime('%c')

        self.log.info(lead + "##### RELEASE #####")
        self.log.info(lead + "## Stable release %(name)s" % newest_stbl)
        self.log.info(lead + "## Published on %s" % published)
        self.log.info(lead + "## Available on %(html_url)s" % newest_stbl)

    # We only show the latest release if it's not
    # also the latest stable release
    if newest_V > newest_stbl_V:
        # We reformat the publication date of the release
        published = datetime.datetime.strptime(
            newest['published_at'],
            "%Y-%m-%dT%H:%M:%SZ").strftime('%c')

        self.log.info(lead + "##### RELEASE #####")
        self.log.info(lead + "## Prerelease %(name)s" % newest)
        self.log.info(lead + "## Published on %s" % published)
        self.log.info(lead + "## Available on %(html_url)s" % newest)

    self.log.info(lead + "###################")

After deleting that part and starting the script I always get something like this in the log:

2018-03-15 00:14:36,033::TraktForVLC::WARNING::Episode : No valid episode found ! 2018-03-15 00:14:36,034::imdbpie.imdbpie::INFO::called search_for_title That 70s Show S01E01 2018-03-15 00:14:36,454::TraktForVLC::INFO::No tv show nor movie found for the current playing video

2018-03-15 00:15:37,352::imdbpie.imdbpie::INFO::called search_for_title Trainspotting 2018-03-15 00:15:37,972::TraktForVLC::INFO::No tv show nor movie found for the current playing video

Although the file is called "Trainspotting.2017".

XaF commented 6 years ago

Hello @adrian70000, TraktForVLC 1.x seems broken at the moment. I'm currently working on finalizing TraktForVLC 2.x in order to release it ASAP. It takes a bit of time, as obviously it's not my main job, but it's on the way! Bear with me :)

adrian70000 commented 6 years ago

Alright, thanks for your effort and good luck :)