@@ -0,0 +1,1016 @@
+# -*- coding: utf-8 -*-%0Aimport argparse%0Aimport re%0Aimport os%0A%0Aos.environ%5B'PYWIKIBOT_DIR'%5D = os.path.dirname(os.path.realpath(__file__))%0Aimport pywikibot%0A%0A%0Asite = pywikibot.Site()%0Asite.login()%0Adatasite = site.data_repository()%0A%0A%0Adef fixUrl(title):%0A    print(title)%0A%0A    myitem = pywikibot.ItemPage(datasite, title)%0A    claims = myitem.get()%5B'claims'%5D%5B'P66'%5D%0A%0A    toRemove = %5B%5D%0A    for claim in claims:%0A        if not re.search(r'%5Ehttps?://zh.moegirl.org', claim.getTarget()):%0A            toRemove.append(claim)%0A%0A    print('toRemove', toRemove)%0A    if not toRemove:%0A        return%0A%0A    myitem.removeClaims(toRemove, summary='%E7%A7%BB%E9%99%A4%E9%8C%AF%E8%AA%A4%E6%94%BE%E7%BD%AE%E7%9A%84%E9%80%A3%E7%B5%90')%0A%0A%0Adef main():%0A    moegirlitem = pywikibot.PropertyPage(datasite, 'Property:P66')%0A%0A    for backlink in moegirlitem.backlinks():%0A        fixUrl(backlink.title())%0A%0A%0Aif __name__ == %22__main__%22:%0A    parser = argparse.ArgumentParser()%0A    parser.add_argument('title', nargs='?')%0A    args = parser.parse_args()%0A    if args.title is None:%0A        main()%0A    else:%0A        fixUrl(args.title)%0A

Create remove-wrong-url