Mercurial > codedump
comparison nhentai.py @ 40:2aa9614cb39a
flake8
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 21 Jun 2021 15:16:15 -0400 |
parents | 05978f04869b |
children |
comparison
equal
deleted
inserted
replaced
39:a93c352af05e | 40:2aa9614cb39a |
---|---|
1 import os, argparse, sys | 1 import os |
2 import argparse | |
3 import sys | |
4 | |
2 | 5 |
3 def main(argv): | 6 def main(argv): |
4 global outputfile | 7 global outputfile |
5 parser = argparse.ArgumentParser() | 8 parser = argparse.ArgumentParser() |
6 parser.add_argument('-o', '--output', help="output file, defaults to urls.txt", metavar='<output>', required=True) | 9 parser.add_argument( |
10 '-o', '--output', help="output file, defaults to urls.txt", | |
11 metavar='<output>', required=True) | |
7 args = parser.parse_args() | 12 args = parser.parse_args() |
8 if args.output: | 13 if args.output: |
9 outputfile = args.output | 14 outputfile = args.output |
10 a = ["257892", "226942", "236297", "216039", "221711", "267371", "235905", "266808", "262036", "206069", "245304", "166174", "175220", "244327", "191049", "147577", "188940", "240543", "165264", "267384", "220882", "244859", "227446", "259322", "259862", "267372", "234932", "247540", "253687", "259569", "259758", "259555", "242505", "255388", "262042", "231290", "250827", "247175", "258728", "264370", "146718", "202230", "259668", "259848", "259542", "266772", "267243", "264901", "263960", "262771", "259420", "188717", "259727", "257889", "259904", "247703", "244427", "242070", "238845", "228510", "258136", "259906", "259986", "216926", "197648", "228426", "225259", "229779", "228922", "103383", "232854", "156069", "122984", "260026", "259634", "160556", "100094", "169468", "204746", "219077", "259610", "259348", "258669", "256097", "118282", "269329", "173023", "186446", "229948", "256088", "260028", "260058", "259557", "259497", "122220", "269582", "270455", "256776", "238651", "242543", "260111", "260088", "259880", "258977", "260097", "263329", "127727", "256789", "256787", "217410", "259765", "259359", "260138", "259617", "107965", "269413", "268926", "208174", "211112", "225664", "197255", "260276", "260209", "260210", "260203", "266834", "196341", "267924", "258212", "248769", "191360", "191390", "248933", "257567", "227913", "219077", "204746", "204066", "007693", "007695", "211648", "210240", "260626", "259622", "257991", "017131", "130602", "172787", "043168", "050856", "213966", "260623", "149112", "252168", "198203", "056657", "064707", "162677", "079712", "167450", "114783", "220958", "244387", "243734", "223315", "102346", "183783", "114427", "119726", "142154", "118069", "136188", "260686", "241777", "260912", "152889", "186055", "204746", "270536", "270528", "142154", "119298", "261174", "258301", "256808", "270415", "270393", "270240", "269871", "269834", "169134", "220354", "260271", "261725", "261378", "269821", "269740", "269721", "269672", "269649", "252174", "261928", "114427", "187003", "147572", "269638", "269434", "269279", "256302", "242517", "249458", "157767", "224316", "175294", "258450", "212347", "268820", "268306", "266301", "265066", "233864", "236128", "261162", "174036", "187205", "270424", "269374", "269067", "268742", "267859", "210873", "193318", "110232", "199310", "193816", "270629", "270628", "270517", "270435", "270174", "220376", "193814", "193815", "219068", "220386", "269064", "269653", "279474", "269366", "268487", "177642", "188269", "181837", "220377", "119293", "268328", "268423", "267935", "265575", "265453", "257528", "258926", "262384", "105951", "259904", "265002", "265085", "270559", "270347", "266882", "208174", "249229", "245644", "262538", "234818", "266442", "264901", "263960", "262771", "262326", "216845", "149212", "134442", "135927", "262447", "261539", "269370", "258301", "256785", "256808", "261811", "261650", "261225", "261226", "260761", "255351", "253306", "242070", "235763", "230437", "250327", "192327", "167801", "150309", "123554", "233736", "260606", "253099", "236707", "231576"] | 15 a = ["257892", "226942", "236297", "216039", "221711", "267371", "235905", |
16 "266808", "262036", "206069", "245304", "166174", "175220", "244327", | |
17 "191049", "147577", "188940", "240543", "165264", "267384", "220882", | |
18 "244859", "227446", "259322", "259862", "267372", "234932", "247540", | |
19 "253687", "259569", "259758", "259555", "242505", "255388", "262042", | |
20 "231290", "250827", "247175", "258728", "264370", "146718", "202230", | |
21 "259668", "259848", "259542", "266772", "267243", "264901", "263960", | |
22 "262771", "259420", "188717", "259727", "257889", "259904", "247703", | |
23 "244427", "242070", "238845", "228510", "258136", "259906", "259986", | |
24 "216926", "197648", "228426", "225259", "229779", "228922", "103383", | |
25 "232854", "156069", "122984", "260026", "259634", "160556", "100094", | |
26 "169468", "204746", "219077", "259610", "259348", "258669", "256097", | |
27 "118282", "269329", "173023", "186446", "229948", "256088", "260028", | |
28 "260058", "259557", "259497", "122220", "269582", "270455", "256776", | |
29 "238651", "242543", "260111", "260088", "259880", "258977", "260097", | |
30 "263329", "127727", "256789", "256787", "217410", "259765", "259359", | |
31 "260138", "259617", "107965", "269413", "268926", "208174", "211112", | |
32 "225664", "197255", "260276", "260209", "260210", "260203", "266834", | |
33 "196341", "267924", "258212", "248769", "191360", "191390", "248933", | |
34 "257567", "227913", "219077", "204746", "204066", "007693", "007695", | |
35 "211648", "210240", "260626", "259622", "257991", "017131", "130602", | |
36 "172787", "043168", "050856", "213966", "260623", "149112", "252168", | |
37 "198203", "056657", "064707", "162677", "079712", "167450", "114783", | |
38 "220958", "244387", "243734", "223315", "102346", "183783", "114427", | |
39 "119726", "142154", "118069", "136188", "260686", "241777", "260912", | |
40 "152889", "186055", "204746", "270536", "270528", "142154", "119298", | |
41 "261174", "258301", "256808", "270415", "270393", "270240", "269871", | |
42 "269834", "169134", "220354", "260271", "261725", "261378", "269821", | |
43 "269740", "269721", "269672", "269649", "252174", "261928", "114427", | |
44 "187003", "147572", "269638", "269434", "269279", "256302", "242517", | |
45 "249458", "157767", "224316", "175294", "258450", "212347", "268820", | |
46 "268306", "266301", "265066", "233864", "236128", "261162", "174036", | |
47 "187205", "270424", "269374", "269067", "268742", "267859", "210873", | |
48 "193318", "110232", "199310", "193816", "270629", "270628", "270517", | |
49 "270435", "270174", "220376", "193814", "193815", "219068", "220386", | |
50 "269064", "269653", "279474", "269366", "268487", "177642", "188269", | |
51 "181837", "220377", "119293", "268328", "268423", "267935", "265575", | |
52 "265453", "257528", "258926", "262384", "105951", "259904", "265002", | |
53 "265085", "270559", "270347", "266882", "208174", "249229", "245644", | |
54 "262538", "234818", "266442", "264901", "263960", "262771", "262326", | |
55 "216845", "149212", "134442", "135927", "262447", "261539", "269370", | |
56 "258301", "256785", "256808", "261811", "261650", "261225", "261226", | |
57 "260761", "255351", "253306", "242070", "235763", "230437", "250327", | |
58 "192327", "167801", "150309", "123554", "233736", "260606", "253099", | |
59 "236707", "231576"] | |
11 if os.path.exists(outputfile): | 60 if os.path.exists(outputfile): |
12 answer = "" | 61 answer = "" |
13 while answer not in ["y", "n", "yes", "no"]: | 62 while answer not in ["y", "n", "yes", "no"]: |
14 print(f"{outputfile} still exists. Delete it? [y/n]: ", end = "") | 63 print(f"{outputfile} still exists. Delete it? [y/n]: ", end="") |
15 answer = input().lower() | 64 answer = input().lower() |
16 if answer in ["y", "yes"]: | 65 if answer in ["y", "yes"]: |
17 os.remove(outputfile) | 66 os.remove(outputfile) |
18 else: | 67 else: |
19 sys.exit() | 68 sys.exit() |
20 for i in a: | 69 for i in a: |
21 myfile = open(outputfile, "a") | 70 myfile = open(outputfile, "a") |
22 myfile.write(f"https://nhentai.org/g/{i}\n") | 71 myfile.write(f"https://nhentai.org/g/{i}\n") |
23 myfile.close() | 72 myfile.close() |
24 print("URLs successfully written!") | 73 print("URLs successfully written!") |
74 | |
75 | |
25 if __name__ == "__main__": | 76 if __name__ == "__main__": |
26 main(sys.argv[1:]) | 77 main(sys.argv[1:]) |