V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
gfgrgerg
V2EX  ›  问与答

https everywhere插件 规则 *.googlevideo\.com

  •  
  •   gfgrgerg · Oct 24, 2013 · 5002 views
    This topic created in 4580 days ago, the information mentioned may be changed or developed.
    ^http?:\/\/.+\.googlevideo\.com我写的,不是程序员悲剧了,不行啊到底要怎么写

    求https everywhere规则
    http://r5---sn-i3b7snl7.googlevideo.com/videoplayback?gcr=

    http://r4---sn-i3b7snl7.googlevideo.com/videopla


    //googlevideo.com前面任意字符
    转成
    https://xx---xxxxxx-xxxx.googlevideo.com/这样
    2 replies    1970-01-01 08:00:00 +08:00
    wuhx
        1
    wuhx  
       Oct 25, 2013
    什么语言啊?
    python的话,这样:

    replaceme = "xxxxx"
    url = "http://r5---sn-i3b7snl7.googlevideo.com/videoplayback?gcr="
    re.sub(r'(^https?://)([a-zA-Z0-9-]*)(.*)', r'\g<1>'+replaceme+r'\g<3>', url)
    gfgrgerg
        2
    gfgrgerg  
    OP
       Oct 27, 2013
    感谢回答解决了,看了1小时正则<rule from="^http://([^/@:\.]+)\.googlevideo\.com/" to="https://$1.googlevideo.com/"/></ruleset>
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2924 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 12:43 · PVG 20:43 · LAX 05:43 · JFK 08:43
    ♥ Do have faith in what you're doing.