stop injecting adcopy_response

This commit is contained in:
Amm0ni4 2024-01-25 23:38:14 +00:00
parent 5ce54931ab
commit 6d32286fa5
3 changed files with 29 additions and 5 deletions

View file

@ -42,6 +42,18 @@ def does_not_contain_any(input_string, string_list):
return False return False
return True return True
def remove_lines_with_strings(js_code, strings_to_remove):
# Split the JavaScript code into lines
lines = js_code.split('\n')
# Filter out lines that start with the specified strings
filtered_lines = [line for line in lines if not any(line.startswith(s) for s in strings_to_remove)]
# Join the filtered lines back into a string
filtered_code = '\n'.join(filtered_lines)
return filtered_code
def modify_script_extra(file_path): def modify_script_extra(file_path):
try: try:
with open(file_path, 'r', encoding='utf-8') as file: with open(file_path, 'r', encoding='utf-8') as file:
@ -67,20 +79,34 @@ def modify_script_extra(file_path):
## Remove tracking iframe being injected ## Remove tracking iframe being injected
content = remove_lines_with_url(content, "https://menrealitycalc.com/") content = remove_lines_with_url(content, "https://menrealitycalc.com/")
## Remove weird datalist "adcopy_response" injected
strings_to_remove = [
" elementReady('[name=adcopy_response]')",
" const PHRASES = ['1.21 gigawatts'",
" const datalist = document.createElement('datalist')"
]
content = remove_lines_with_strings(content, strings_to_remove)
## Check known issues have been removed and remove antifeature label if corrected ## Check known issues have been removed and remove antifeature label if corrected
strings_to_check = [ strings_to_check = [
"rotator.nurul-huda.sch.id/?BypassResults=", "rotator.nurul-huda.sch.id/?BypassResults=",
"free4u.nurul-huda.or.id/?BypassResults=", "free4u.nurul-huda.or.id/?BypassResults=",
"https://menrealitycalc.com/", "https://menrealitycalc.com/",
"createElement('iframe')" "createElement('iframe')",
"adcopy_response"
] ]
if does_not_contain_any(content, strings_to_check): if does_not_contain_any(content, strings_to_check):
content = content.replace("\n// @antifeature tracking", "") content = content.replace("\n// @antifeature tracking", "")
else: else:
print("ERROR: TRACKING NOT REMOVED.") print("ERROR: TRACKING NOT REMOVED.")
open("Bypass_All_Shortlinks.user.js", "w").close() # Clear file #open("Bypass_All_Shortlinks.user.js", "w").close() # Clear file
return False return False
# Check the code ends with a line jump
if not content.endswith('\n'):
content += '\n'
# Write the modified content back to the file # Write the modified content back to the file
with open(file_path, 'w', encoding='utf-8') as file: with open(file_path, 'w', encoding='utf-8') as file:
file.write(content) file.write(content)

File diff suppressed because one or more lines are too long

View file

@ -13,6 +13,7 @@ Automatically bypass many link shorteners [(supported_sites.txt)](https://codebe
- The script will not redirect to 'rotator.nurul-huda.sch.id' or 'free4u.nurul-huda.or.id' before your destination URL, which are intermediary sites set by the developer for [collecting analytics](https://i.ibb.co/D1zYG1v/topcountry17-04-2023.jpg) and showing ads. - The script will not redirect to 'rotator.nurul-huda.sch.id' or 'free4u.nurul-huda.or.id' before your destination URL, which are intermediary sites set by the developer for [collecting analytics](https://i.ibb.co/D1zYG1v/topcountry17-04-2023.jpg) and showing ads.
- The script will not inject the iframe that is injected for tracking in the original version in this line: - The script will not inject the iframe that is injected for tracking in the original version in this line:
```let visitors = document.createElement('iframe');visitors.src = 'https://menrealitycalc.com/greasyfork';visitors.style.cssText = "width: 0%; height: 0%; border: none;";document.body.appendChild(visitors);let btz = bp('.banner-ad > script:nth-child(9)' || '.panel-body > script:nth-child(7)' || 'div.adb-top > script:nth-child(10)');``` ```let visitors = document.createElement('iframe');visitors.src = 'https://menrealitycalc.com/greasyfork';visitors.style.cssText = "width: 0%; height: 0%; border: none;";document.body.appendChild(visitors);let btz = bp('.banner-ad > script:nth-child(9)' || '.panel-body > script:nth-child(7)' || 'div.adb-top > script:nth-child(10)');```
- The script will not inject this weird _adcopy_response_ in all the supported sites.
Original script by *bloggerpemula*: [greasyfork.org/scripts/431691](https://greasyfork.org/scripts/431691) Original script by *bloggerpemula*: [greasyfork.org/scripts/431691](https://greasyfork.org/scripts/431691)