Take crosspost parent as url when available.
This commit is contained in:
parent
08cfa3db0e
commit
c8c160e00e
1 changed files with 6 additions and 1 deletions
|
@ -396,8 +396,13 @@ class TSDB:
|
|||
if submission.is_self:
|
||||
# Selfpost's URL leads back to itself, so just ignore it.
|
||||
url = None
|
||||
elif hasattr(submission, 'crosspost_parent') and getattr(submission, 'crosspost_parent_list'):
|
||||
url = submission.crosspost_parent_list[0]['permalink']
|
||||
else:
|
||||
url = submission.url
|
||||
url = getattr(submission, 'url', None)
|
||||
|
||||
if url and url.startswith('/r/'):
|
||||
url = 'https://reddit.com' + url
|
||||
|
||||
postdata = {
|
||||
'idint': common.b36(submission.id),
|
||||
|
|
Loading…
Reference in a new issue