Remove base64 and URL decoding
This commit is contained in:
@@ -152,3 +152,6 @@ You can use any regex pattern, including:
|
||||
|
||||
The pattern is matched against the entire post text, so you can create complex filtering rules.
|
||||
|
||||
For some applications you will need to convert the request to an encoded URL:
|
||||
```Салли.*и.*Фасолька|Увядший.*Лепесток``` -> ```%D0%A1%D0%B0%D0%BB%D0%BB%D0%B8.%2A%D0%B8. %2A%D0%A4%D0%B0%D1%81%D0%BE%D0%BB%D1%8C%D0%BA%D0%B0%7C%D0%A3%D0%B2%D1%8F%D0%B4%D1%88%D0%B8%D0%B9.%2A%D0%9B%D0%B5%D0%BF%D0%B5%D1%81%D1%82%D0%BE%D0%BA```
|
||||
For example, you can use this tool: https://www.urlencoder.org/
|
||||
@@ -587,14 +587,6 @@ async def get_rss_feed(channel: str,
|
||||
#logger.info(f"valid_token: token {token}")
|
||||
while True:
|
||||
try:
|
||||
if exclude_text: # Decode base64 parameters if they are encoded
|
||||
try:
|
||||
exclude_text = base64.b64decode(exclude_text.encode()).decode('utf-8') # Try to decode as base64 first
|
||||
except Exception: # If base64 decoding fails, try URL decoding
|
||||
try:
|
||||
exclude_text = exclude_text.encode('latin1').decode('utf-8')
|
||||
except UnicodeError:
|
||||
pass # If all decoding fails, use original value
|
||||
|
||||
if output_type == 'rss':
|
||||
rss_content = await generate_channel_rss(channel,
|
||||
|
||||
Reference in New Issue
Block a user