Skip to content

Commit

Permalink
Merge pull request #4399 from oscaropenness/matrix
Browse files Browse the repository at this point in the history
[plugin.video.ctuplinkrss] 1.3
  • Loading branch information
pkscout authored Oct 9, 2023
2 parents a0a68fa + 335b10b commit 8df71b3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
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

0 comments on commit 8df71b3

Please sign in to comment.