mirror of https://gitlab.com/bashrc2/epicyon
Modify mirrored news links
parent
ee9d9a9dc5
commit
b9fc4bbf6e
|
@ -488,14 +488,19 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
|
||||||
rssDescription = rssDescription.replace(']]>', '')
|
rssDescription = rssDescription.replace(']]>', '')
|
||||||
rssDescription = '<p>' + rssDescription + '<p>'
|
rssDescription = '<p>' + rssDescription + '<p>'
|
||||||
|
|
||||||
|
mirrored = item[7]
|
||||||
|
postUrl = url
|
||||||
|
if mirrored and '://' in url:
|
||||||
|
postUrl = '/newsmirror/' + url.split('://')[1]
|
||||||
|
|
||||||
# add the off-site link to the description
|
# add the off-site link to the description
|
||||||
if rssDescription and not dangerousMarkup(rssDescription):
|
if rssDescription and not dangerousMarkup(rssDescription):
|
||||||
rssDescription += \
|
rssDescription += \
|
||||||
'<br><a href="' + url + '">' + \
|
'<br><a href="' + postUrl + '">' + \
|
||||||
translate['Read more...'] + '</a>'
|
translate['Read more...'] + '</a>'
|
||||||
else:
|
else:
|
||||||
rssDescription = \
|
rssDescription = \
|
||||||
'<a href="' + url + '">' + \
|
'<a href="' + postUrl + '">' + \
|
||||||
translate['Read more...'] + '</a>'
|
translate['Read more...'] + '</a>'
|
||||||
|
|
||||||
# remove image dimensions
|
# remove image dimensions
|
||||||
|
@ -517,7 +522,6 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
|
||||||
if not blog:
|
if not blog:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
mirrored = item[7]
|
|
||||||
if mirrored:
|
if mirrored:
|
||||||
if not createNewsMirror(baseDir, statusNumber,
|
if not createNewsMirror(baseDir, statusNumber,
|
||||||
url, maxMirroredArticles):
|
url, maxMirroredArticles):
|
||||||
|
|
Loading…
Reference in New Issue