Created
January 20, 2021 16:22
-
-
Save arpruss/cb2a07f8a8ef46dca3fdd30ff7871a1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
with open("c:/chrome-with-flash-session/chrome_debug.log") as f: | |
with open("c:/chrome-with-flash-session/Default/Pepper Data/Shockwave Flash/System/mms.cfg", "a+") as out: | |
out.write("\n") | |
def add(url): | |
print(url) | |
out.write("AllowListUrlPattern="+url+"\n") | |
for line in f: | |
m = re.match(r'[^"]+"SWF : \*\*\* EnableAllowList blocks \'([^\']+)\'', line) | |
#m = re.match(r'[^"]+"SWF', line) | |
if m: | |
url = m.group(1) | |
url = re.sub(r'^https?:','*:',url) | |
m = re.match(r'^([^:]+)://([^/]+)/',url) | |
if m: | |
if m.group(2).count('.') > 1: | |
add(m.group(1)+"://"+re.sub(r'^[^.]*', '*', m.group(2))+'/') | |
add(m.group(1)+"://"+m.group(2)+"/") | |
# [3464:9292:0120/095625.730:INFO:CONSOLE(1)] "SWF : *** EnableAllowList blocks 'https://www.ultrasounds.com/test.swf'. ***", source: (1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment