fix this https://rdrama.net/h/slackernews/post/250030/nintendo-yuzu-lolsuit-was-kicked-off/6035221#context
parent
9d18fa45eb
commit
3b1e507c47
|
@ -51,6 +51,23 @@ def snappy_report(post, reason):
|
||||||
message = f'@Snappy reported {post.textlink})\n\n> {reason}'
|
message = f'@Snappy reported {post.textlink})\n\n> {reason}'
|
||||||
send_repeatable_notification(post.author_id, message)
|
send_repeatable_notification(post.author_id, message)
|
||||||
|
|
||||||
|
def get_archival_urls(href):
|
||||||
|
addition = ''
|
||||||
|
if href.startswith('https://old.reddit.com/r/'):
|
||||||
|
rev = href.replace('https://old.reddit.com/', '')
|
||||||
|
addition += f'* [undelete.pullpush.io](https://undelete.pullpush.io/{rev})\n\n'
|
||||||
|
elif href.startswith('https://old.reddit.com/user/'):
|
||||||
|
rev = href.replace('https://old.reddit.com/user/', '')
|
||||||
|
addition += f"* [search-new.pullpush.io](https://search-new.pullpush.io/?author={rev}&type=submission)\n\n"
|
||||||
|
elif href.startswith('https://boards.4chan.org/'):
|
||||||
|
rev = href.replace('https://boards.4chan.org/', '')
|
||||||
|
addition += f'* [archived.moe](https://archived.moe/{rev})\n\n'
|
||||||
|
|
||||||
|
addition += f'* [ghostarchive.org](https://ghostarchive.org/search?term={quote(href)})\n\n'
|
||||||
|
addition += f'* [archive.org](https://web.archive.org/{href})\n\n'
|
||||||
|
addition += f'* [archive.ph](https://archive.ph/?url={quote(href)}&run=1) (click to archive)\n\n'
|
||||||
|
return addition
|
||||||
|
|
||||||
def execute_snappy(post, v):
|
def execute_snappy(post, v):
|
||||||
if post.hole and g.db.query(Exile.user_id).filter_by(user_id=SNAPPY_ID, hole=post.hole).one_or_none():
|
if post.hole and g.db.query(Exile.user_id).filter_by(user_id=SNAPPY_ID, hole=post.hole).one_or_none():
|
||||||
return
|
return
|
||||||
|
@ -194,15 +211,7 @@ def execute_snappy(post, v):
|
||||||
body += "\n\n"
|
body += "\n\n"
|
||||||
|
|
||||||
if post.url and not post.url.startswith('/') and not post.url.startswith(f'{SITE_FULL}/') and not post.url.startswith(SITE_FULL_IMAGES):
|
if post.url and not post.url.startswith('/') and not post.url.startswith(f'{SITE_FULL}/') and not post.url.startswith(SITE_FULL_IMAGES):
|
||||||
if post.url.startswith('https://old.reddit.com/r/'):
|
body += f"Snapshots:\n\n{get_archival_urls(post.url)}"
|
||||||
rev = post.url.replace('https://old.reddit.com/', '')
|
|
||||||
rev = f"* [undelete.pullpush.io](https://undelete.pullpush.io/{rev})\n\n"
|
|
||||||
elif post.url.startswith("https://old.reddit.com/user/"):
|
|
||||||
rev = post.url.replace('https://old.reddit.com/user/', '')
|
|
||||||
rev = f"* [search-new.pullpush.io](https://search-new.pullpush.io/?author={rev}&type=submission)\n\n"
|
|
||||||
else: rev = ''
|
|
||||||
|
|
||||||
body += f"Snapshots:\n\n{rev}* [ghostarchive.org](https://ghostarchive.org/search?term={quote(post.url)})\n\n* [archive.org](https://web.archive.org/{post.url})\n\n* [archive.ph](https://archive.ph/?url={quote(post.url)}&run=1) (click to archive)\n\n"
|
|
||||||
archive_url(post.url)
|
archive_url(post.url)
|
||||||
|
|
||||||
captured = []
|
captured = []
|
||||||
|
@ -222,15 +231,7 @@ def execute_snappy(post, v):
|
||||||
if "Snapshots:\n\n" not in body: body += "Snapshots:\n\n"
|
if "Snapshots:\n\n" not in body: body += "Snapshots:\n\n"
|
||||||
if f'**[{title}]({href})**:\n\n' not in body:
|
if f'**[{title}]({href})**:\n\n' not in body:
|
||||||
addition = f'**[{title}]({href})**:\n\n'
|
addition = f'**[{title}]({href})**:\n\n'
|
||||||
if href.startswith('https://old.reddit.com/r/'):
|
addition += get_archival_urls(href)
|
||||||
rev = href.replace('https://old.reddit.com/', '')
|
|
||||||
addition += f'* [undelete.pullpush.io](https://undelete.pullpush.io/{rev})\n\n'
|
|
||||||
elif href.startswith('https://old.reddit.com/user/'):
|
|
||||||
rev = href.replace('https://old.reddit.com/user/', '')
|
|
||||||
addition += f"* [search-new.pullpush.io](https://search-new.pullpush.io/?author={rev}&type=submission)\n\n"
|
|
||||||
addition += f'* [ghostarchive.org](https://ghostarchive.org/search?term={quote(href)})\n\n'
|
|
||||||
addition += f'* [archive.org](https://web.archive.org/{href})\n\n'
|
|
||||||
addition += f'* [archive.ph](https://archive.ph/?url={quote(href)}&run=1) (click to archive)\n\n'
|
|
||||||
if len(f'{body}{addition}') > COMMENT_BODY_LENGTH_LIMIT: break
|
if len(f'{body}{addition}') > COMMENT_BODY_LENGTH_LIMIT: break
|
||||||
body += addition
|
body += addition
|
||||||
archive_url(href)
|
archive_url(href)
|
||||||
|
|
|
@ -7,6 +7,9 @@ BOOSTED_SITES = {
|
||||||
#4chan-like
|
#4chan-like
|
||||||
#'all sites with the word "chan" in the domain',
|
#'all sites with the word "chan" in the domain',
|
||||||
'archived.moe',
|
'archived.moe',
|
||||||
|
'desuarchive.org',
|
||||||
|
'archive.4plebs.org',
|
||||||
|
'arch.b4k.co',
|
||||||
'lolcow.farm',
|
'lolcow.farm',
|
||||||
'8kun.top',
|
'8kun.top',
|
||||||
'soyjak.party',
|
'soyjak.party',
|
||||||
|
|
|
@ -742,11 +742,7 @@ domain_replacements = {
|
||||||
'https://letmegooglethat.com/?q=': 'https://google.com/search?q=',
|
'https://letmegooglethat.com/?q=': 'https://google.com/search?q=',
|
||||||
'https://lmgtfy.app/?q=': 'https://google.com/search?q=',
|
'https://lmgtfy.app/?q=': 'https://google.com/search?q=',
|
||||||
DONATE_LINK: f'{SITE_FULL}/donate',
|
DONATE_LINK: f'{SITE_FULL}/donate',
|
||||||
'https://boards.4chan.org/': 'https://archived.moe/',
|
'https://boards.4channel.org/': 'https://boards.4chan.org/',
|
||||||
'https://boards.4channel.org/': 'https://archived.moe/',
|
|
||||||
'https://desuarchive.org/': 'https://archived.moe/',
|
|
||||||
'https://archive.4plebs.org/': 'https://archived.moe/',
|
|
||||||
'https://arch.b4k.co/': 'https://archived.moe/',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def normalize_url(url):
|
def normalize_url(url):
|
||||||
|
|
Loading…
Reference in New Issue