mirror of
https://github.com/kemayo/leech
synced 2026-04-21 12:00:50 +02:00
Don't break trying to de-cloudflare links without an href
This commit is contained in:
parent
a570580f98
commit
14e7d5bf1b
1 changed files with 1 additions and 1 deletions
|
|
@ -315,7 +315,7 @@ class Site:
|
|||
# See: https://usamaejaz.com/cloudflare-email-decoding/
|
||||
enc = bytes.fromhex(tag['data-cfemail'])
|
||||
email = bytes([c ^ enc[0] for c in enc[1:]]).decode('utf8')
|
||||
if tag.parent.name == 'a' and tag.parent['href'].startswith('/cdn-cgi/l/email-protection'):
|
||||
if tag.parent.name == 'a' and 'href' in tag.parent and tag.parent['href'].startswith('/cdn-cgi/l/email-protection'):
|
||||
tag = tag.parent
|
||||
tag.insert_before(email)
|
||||
tag.decompose()
|
||||
|
|
|
|||
Loading…
Reference in a new issue