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

[plugin.video.ctuplinkrss] 1.3 #4399

Merged
merged 1 commit into from
Oct 9, 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
4 changes: 2 additions & 2 deletions plugin.video.ctuplinkrss/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.ctuplinkrss" version="1.2" name="heise c't uplink" provider-name="Unofficial - Oscar Open">
<addon id="plugin.video.ctuplinkrss" version="1.3" name="heise c't uplink" provider-name="Unofficial - Oscar Open">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.feedparser" version="6.0.2"/>
Expand All @@ -15,7 +15,7 @@
<platform>all</platform>
<license>GPL-3.0-only</license>
<source>https://github.com/oscaropenness/plugin.video.ctuplinkrss</source>
<news>v1.2 (2021-04-09) [fix] release for Kodi 19 Matrix
<news>v1.3 (2023-09-01) [fix] Aired date not correctly displayed in Kodi.
</news>
<assets>
<icon>icon.png</icon>
Expand Down
22 changes: 20 additions & 2 deletions plugin.video.ctuplinkrss/resources/lib/ctuplinkrss.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,31 @@
# Diese Basisversion entspricht dem Beispiel in c't 19/2018
# eine etwas schönere und umfangreiche Version
# finden Sie unter plugin.audio.ctuplink_audio
import datetime
from sys import version_info

class proxydt(datetime.datetime):
def __new__(cls, *args, **kwargs):
return super(proxydt, cls).__new__(cls, *args, **kwargs)

@classmethod
def strptime(cls, date_string, format):
import time
return datetime(*(time.strptime(date_string, format)[0:6]))

datetime.datetime = proxydt
from datetime import datetime
# import datetime
import sys
import xbmcgui
import xbmcplugin
import xbmcaddon
import feedparser

def convert_rfc1123_to_datetime(date_time):
#Bsp.: Sat, 26 Aug 2023 06:30:00 +0200
format = '%a, %d %b %Y %H:%M:%S %z'
return datetime.strptime(date_time, format)

def run():
#Selbst-Referenzierung fürs Plug-in
Expand All @@ -32,8 +50,8 @@ def run():
for item in d['entries']:
title = item['title']
url = item.enclosures[0].href
date = item['published']
date = str(convert_rfc1123_to_datetime(item['published']).date())

#Beschreibung der Folge auslesen, für Audio nicht notwendig, aber für Audio praktisch
summary = item['description']

Expand Down
Loading