V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
gfgrgerg
V2EX  ›  问与答

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

  •  
  •   gfgrgerg · 2013-10-24 01:28:58 +08:00 · 4168 次点击
    这是一个创建于 3830 天前的主题,其中的信息可能已经有所发展或是发生改变。
    ^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 条回复    1970-01-01 08:00:00 +08:00
    wuhx
        1
    wuhx  
       2013-10-25 12:54:29 +08:00
    什么语言啊?
    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
       2013-10-27 15:59:44 +08:00
    感谢回答解决了,看了1小时正则<rule from="^http://([^/@:\.]+)\.googlevideo\.com/" to="https://$1.googlevideo.com/"/></ruleset>
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1284 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 23:35 · PVG 07:35 · LAX 16:35 · JFK 19:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.