I am not sure if this question should go here.
How should i change the youtube preference cookie so that safety mode is always on?
PREF=f1=50000000&fms2=30000&fms1=30000&fv=10.3.183
This is the pref cookie and fms2 changes to 10000 if safe search is turned off. I used regex replace to replace the text if fms2=10000 comes in the cookie. But this doesn’t seem to work. How do I change the cookie so that turning off safety-mode will turn it back on due to the cookie replace?
First: I am really not sure if I understand your question correctly. For a static string replacement from
fms2=10000tofms2=30000you should not necessarily need to use Regex. “Normal” string replacement would also do it. But I guess there is more? Which language do you use?Second: What do you mean by “that turning off safety-mode will turn it back on due to the cookie replace”? Do you want to swap the logic: “turn off” does actually a “turn on” and vice versa?
Third: Is there some additional modification in your data like URL encoding that you are maybe not aware of?
UPDATE:
My guess for the regex is (PCRE syntax – I am not so familiar with C++)
replaced by
This would match
But it sounds like this is not only a regex problem, isn’t it? Please let me know if you are facing problems or you need an explanation of the pattern.