Links with payment relationship show the buy button

main
Bob Mottram 2023-04-23 09:49:43 +01:00
parent d1236a1816
commit 54185bfb20
1 changed files with 5 additions and 0 deletions

View File

@ -2231,6 +2231,11 @@ def get_buy_links(post_json_object: str, translate: {}, buy_sites: {}) -> {}:
'://' not in item['href'] or \ '://' not in item['href'] or \
' ' in item['href']: ' ' in item['href']:
continue continue
if item.get('rel'):
if item['rel'] in ('payment', 'donate', 'donation',
'buy', 'purchase'):
links[site.title()] = item['href']
continue
if buy_sites: if buy_sites:
# limited to an allowlist of buying sites # limited to an allowlist of buying sites
for site, buy_domain in buy_sites.items(): for site, buy_domain in buy_sites.items():