11'''Telegram bot that (primarily) attempts to perform url hacks to get around paywalls'''
22
33
4- __version__ = '2.5.2'
4+ __version__ = '2.5.2.lol '
55
66
77import asyncio
1414import traceback
1515from io import BytesIO
1616from urllib .parse import urlsplit
17+ from datetime import datetime , timezone , timedelta
1718
1819import httpx
1920from telegram import Update
@@ -269,7 +270,8 @@ async def add_bypasses(url: str) -> str:
269270 (txtify_it , 'txtify.it' ),
270271 (twitter , 'Twitter Embed' ),
271272 (nitter , 'Twiiit' ),
272- (lite_mode , 'Lite Mode' )
273+ (lite_mode , 'Lite Mode' ),
274+ (rick_roll , 'Experimental' )
273275 )
274276
275277 async with httpx .AsyncClient (http2 = True ) as client :
@@ -285,6 +287,20 @@ async def add_bypasses(url: str) -> str:
285287
286288
287289# bypasses
290+ @timer
291+ @snitch
292+ async def rick_roll (url : str , client : httpx .AsyncClient ) -> str | None :
293+ '''Rickrolls people on April 1st'''
294+ def is_april_fools ():
295+ utc_now = datetime .now (timezone .utc )
296+ start_time_utc = datetime (2025 , 4 , 1 , 0 , 0 , tzinfo = timezone .utc ) - timedelta (hours = - 4 ) # EDT
297+ end_time_utc = datetime (2025 , 4 , 2 , 0 , 0 , tzinfo = timezone .utc ) - timedelta (hours = - 7 ) # PDT
298+ return start_time_utc <= utc_now <= end_time_utc
299+
300+ if is_april_fools ():
301+ return 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
302+
303+
288304@timer
289305@snitch
290306async def wayback (url : str , client : httpx .AsyncClient ) -> str | None :
0 commit comments