E-Hentai Wipe Uploader Comment

Erases all pre-uploaded comments from an user's galleries

// ==UserScript==
// @name        E-Hentai Wipe Uploader Comment
// @namespace   E-Hentai
// @description Erases all pre-uploaded comments from an user's galleries
// @include     https://upload.e-hentai.org/manage.php
// @include     https://exhentai.org/upload/manage
// @version     1.01
// @grant       none
// ==/UserScript==

const normalGalleries = ["1171925","1168170","1168169","1168058","1168057","1167987","1167890","1167893","1167883","1167881","1167845","1167843","1167847","1167849","1167853","1167855","1167856","1167857","1158440","1158437","1158436","1158359","1158355","1158351","1158342","1158341","1158340","1158329","1158326","1158325","1158323","1158320","1158319","1158318","1158305","1158302","1158293","1158290","1158266","1158265","1158262","1158259","1158258","1158257","1155620","1155616","1155614","1155571","1155564","1155561","1155559","1155557","1155555","1155549","1155548","1155542","1155541","1155514","1155517","1155515","1155521","1155520","1155513","1155510","1155523","1155507","1155526","1149252","1149249","1149244","1149246","1149247","1149251","1143467","1143042","1143043","1143039","1143038","1140446","1140078","1140079","1140077","1139689","1139695","1139683","1139688","1139662","1139680","1139677","1139672","1139666","1138937","1132894","1132784","1132790","1132793","1132794","1132475","1132477","1132478","1132480","1132473","1132471","1132464","1132459","1132399","1132411","1132413","1132415","1132416","1132422","1132424","1132427","1132435","1132437","1132440","1132441","1132442","1132443","1132445","1132448","1132451","1128424","1128423","1128418","1128421","1128399","1128400","1128407","1128404","1128026","1128024","1128020","1128017","1128016","1125342","1125346","1125344","1125343","1125336","1125334","1125333","1125313","1125315","1125314","1125319","1125321","1122530","1122526","1122527","1122528","1122230","1122238","1122239","1122022","1122021","1122018","1122016","1122006","1122008","1122009","1122012","1122013","1121993","1121994","1121991","1121989","1121985","1121984","1121979","1121956","1121960","1121963","1121967","1121970","1119389","1119388","1119203","1119208","1119205","1119210","1119212","1119213","1119215","1118652","1118651","1118650","1118615","1118611","1118610","1118606","1118607","1118571","1118572","1118579","1118580","1118585","1118587","1118588","1118591","1118595","1118598","1115280","1115281","1115269","1115270","1115272","1115273","1115274","1115276","1115278","1115277","1115068","1114276","1112823","1112824","1112815","1112814","1112816","1112819","1112818","1112795","1112723","1112741","1112742","1112744","1112746","1112735","1112720","1112732","1112733","1111666","1111670","1111673","1111678","1111684","1111657","1111655","1111652","1111647","1111644","1111642","1111640","1111639","1110933","1110931","1110930","1110866","1110878","1110884","1110887","1110888","1110890","1110716","1110718","1110724","1110729","1110734","1110730","1110727","1110725","1110720","1110713","1109213","1109212","1109211","1109209","1109207","1108769","1108770","1108671","1108668","1108665","1108667","1108663","1108662","1108647","1108645","1108641","1108640","1108639","1108636","1108635","1108634","1108611","1108610","1108609","1108577","1104087","1104086","1104084","1104081","1103647","1103648","1103657","1103660","1103602","1103603","1103593","1103592","1103590","1103440","1103435","1103431","1103178","1103183","1103185","1103190","1103193","1103167","1103165","1103163","1103161","1103158","1103094","1103096","1103092","1103093","1103090","1103089","1103088","1103086","1103081","1103076","1097844","1097846","1098031","1098034","1090122","1090120","1090118","1090115","1087371","1087370","1087369","1087368","1087367","1085848","1085467","1085348","1085072","1085071","1084714","1084712","1084709","1084704","1084703","1084702","1084701","1084700","1084699","1084698","1084696","1074855","1074854","1074849","1074848","1074673","1074665","1074664","1074660","1074623","1074624","1074626","1074628","1074361","1074360","1074358","1074283","1074280","1074276","1074274","1074269","1074130","1074132","1074127","1074118","1074101","1074024","1074074","1074037","1074049","1074051","1074034","1074029","1074028","1074032","1074056","1074058","1074062","1074063","1074064","1074023","1074022","1074068","1066051","1066049","1066048","1066047","1066045","1066041","1066040","1066037","1064256","1064258","1064259","1064245","1064243","1064242","1064240","1064180","1064182","1064183","1064148","1064145","1064144","1064143","1064129","1064127","1064121","1064117","1064032","1064028","1064027","1064024","1064012","1064013","1064014","1063810","1063811","1063812","1063562","1063561","1063559","1063557","1063556","1063501","1063502","1063479","1063480","1063482","1063485","1063488","1063492","1063495","1063497","1063498","1061151","1061148","1061149","1060719","1060717","1060716","1060602","1060606","1060600","1060598","1060594","1060523","1060520","1060519","1060516","1060512","1060476","1060469","1060468","1060466","1060446","1060443","1060440","1060438","1060434","1060426","1060420","1060422","1060416","1060413","1060414","1060415","1060404","1060402","1060408","1060407","1060312","1060247","1060250","1060253","1060261","1060265","1060269","1060270","1060278","1060306","1060307","1060310","1048546","1048545","1048544","1048538","1048539","1048540","1048282","1048279","1048013","1048093","1048098","1048099","1048100","1048101","1048105","1048114","1048116","1048118","1048129","1048097","1048090","1048049","1048033","1048027","1048120","1048122","1048125","1048052","1048087","1048082","1048011","1048014","1048015","1048019","1048021","1048029","1048037","1048038","1048040","1048044","1048102","1048106","1048126","1048128","1048142","1048143","1048147","1048146","1048144","1043721","1043712","1043715","1043718","1043705","1043707","1043708","1043709","1043711","1042944","1042927","1042938","1042940","1042941","1042670","1042671","1042673","1042674","1042682","1042632","1042642","1042638","1042628","1042625","1042624","1042616","1042614","1042613","1042608","1042606","1042600","1042599","1042597","1042598","1040018","1040019","1039806","1039811","1039812","1039782","1039784","1039788","1039567","1039563","1039561","1039559","1039551","1039478","1039479","1039481","1039482","1039484","1039431","1039443","1039441","1039438","1039434","1039430","1037613","1037614","1037616","1037402","1037401","1037403","1037395","1037368","1037370","1037186","1037184","1037177","1037175","1037197","1037192","1037044","1037042","1037038","1037007","1037028","1037030","1037033","1037034","1037032","1037027","1037024","1037023","1037004","1037003","1037002","1036998","1036997","1036996","1036992","1036994","1036990","1036988","1032612","1032607","1032605","1032606","1032608","1028271","1028267","1028275","1028276","1028277","1028279","1028281","1028285","1028287","1028290","1028291","1028292","1028297","1028348","1028350","1028353","1028354","1028356","1028358","1028360","1028369","1028370","1028375","1028377","1028384","1028382","1024208","1024203","1024209","1021525","1021591","1021522","1021519","1021523","1021435","1021436","1021424","1021425","1021427","1021429","1021186","1021184","1021183","1021182","1021181","1021179","1021017","1021016","1021014","1021013","1021011","1021008","1021007","1021005","1021001","1020998","1020957","1020959","1020963","1020962","1020965","1020967","1020970","1020973","1020975","1020976","1020978","1020982","1020983","1020986","1020990","1020993","1015394","1013247","1013248","1013050","1013048","1013053","1013031","1013038","1013042","1013036","1013023","1013003","1012989","1013051","1012999","1012998","1013020","1013019","1013027","1012994","1012988","1012987","1012986","1013162","1013163","1013178","1013176","1013170","1013168","1013165","1013161","1013071","1013066","1013062","1013057","1013054","1013040","1013030","1013025","1012981","1010580","1010579","1008851","1008863","1008849","1008850","1008843","1008844","1008845","1008713","1008704","1008706","1008708","1008709","1008710","1008681","1008682","1008683","1008685","1008686","1008687","1008689","1008691","1008693","1008694","1008696","1005955","1005956","1005953","1005947","1005824","1005826","1005828","1005830","1005808","1005803","1005807","1005768","1005769","1005770","1005771","1005774","1005775","1005776","1005752","1005754","1005755","1005763","1005765","1005766","1003396","1003395","1003386","1003389","1003397","1003398","1003382","1003385","1003381","1003379","1003378","1003377","1003376","1003375","1002991","1002990","1001541","1001540","1001492","1001491","1001488","1001480","1001478","1001477","1001475","1001473","1001431","1001432","1001433","1001435","1001436","1001424","1001425","1001426","1001427","1001428","1001420","1001419","1001418","1001417","1001421","1001416","1001415","1001410","1001413","1001414","997823","997822","996608","996606","996604","996577","996578","996579","996566","996567","996568","996569","996570","996572","996573","996561","996559","996558","996557","996555","996554","996553","996552","996551","996549","996548","995193","995189","995191","995185","995178","995177","995173","995171","995156","995155","995153","995152","995151","995149","995147","995146","995144","995143","995140","995139","993483","993484","993485","991417","991361","991338","991339","991340","991342","991351","991352","991353","991354","991355","991356","991357","991358","991359","991360","991363","991364","991365","991368","991369","991371","991380","991381","991418","989128","989190","989181","989166","989164","989163","989158","989151","989148","989146","989144","989142","989136","989133","989129","989118","988056","988055","988054","988053","988052","988051","988050","988049","986083","986082","986052","986056","986071","986048","986080","986077","986075","986072","986067","986066","986065","986064","986062","986060","986058","986054","986053","986051","986050","986047","986046","984494","984493","984492","979473","979461","979471","979469","979426","979422","979419","979414","979417","979399","979409","979406","979408","979401","979386","979371","979382","979383","979381","979374","979370","979368","979390","979378","978198","978197","978202","975638","975637","969396","969389","969394","969393","969392","969344","969343","969336","969309","969310","969313","969316","969318","969322","969323","964487","964488","963370","962150","957521","957516","957515","955268","955254","955277","955279","955252","954909","954020","954017","954016","954013","954010","954009","953969","953154","953125","953117","951347","951346","951344","951343","951342","951339","949627","949626","949622","949618","949615","949616","949617","949614","949610","949608","949604","949601","949602","949258","947857","947300","947275","947273","947272","947238","947241","947242","947245","947214","947216","947217","947218","947219","947221","947223","947224","947228","947234","947178","947177","947182","947180","947175","947176","945438","943025","943024","943021","943020","943017","943016","943012","941953","941952","939399","938228","938227","938223","938221","936177","935358","935354","935355","935353","935352","935351","931814","930950","930948","929322","929321","929320","925809","925808","925807","921872","921863","921862","921861","921815","921814","921812","921811","921809","921808","921562","921548","921544","921557","921556","921549","921541","921538","921471","921470","921469","921465","921464","921463","921537","921536","917675","917677","917676","915517","915099","914135","914136","912576","912573","912568","912534","912533","912535","912537","912479","912477","912473","912472","912471","912470","912466","912464","912461","912457","912454","910863","910861","910860","908463","908466","906807","906620","906529","906530","906531","906533","906036","904029","904028","904030","902860","902858","902859","902817","902816","902814","902809","902804","902801","902800","902799","901751","901749","901748","901743","901742","901740","901739","901737","901735","901734","901736","901732","901729","901728","901721","901720","901719","901716","901715","901709","901708","901704","901696","901030","898174","898171","898169","898077","896789","896787","895166","894422","893809","893108","892014","892017","891207","891088","891089","889411","889409","889336","889337","889333","889316","889318","889313","889314","889310","889312","889306","889303","889301","889298","889297","889280","889296","889279","889294","889278","887952","887954","887784","887667","887778","887777","887666","887665","887663","887662","887330","887331","887329","887327","887328","887324","887323","886976","886972","886974","886874","886875","886884","886876","886873","886838","886837","886836","886831","886828","886826","886824","886282","886122","886121","886047","886046","886045","886029","886027","886026","886022","886019","886020","886017","886016","885737","885739","885741","885742","885745","885747","885591","885575","885555","885600","885656","885608","885633","885632","885631","885630","885629","885621","885620","885619","885618","885617","885605","885604","885598","885603","885602","885594","885593","885590","885595","885588","885587","885574","885572","885570","885568","885567","885566","885565","885564","885563","885561","885549","885576","885548","885658","885657","885655","885651","885645","885641","885640","885639","885637","884118","883953","883955","883943","883949","879962","875855","875854","875726","875768","875764","875763","875734","875756","875759","875758","875754","875753","875751","875750","875749","875747","875746","875745","875743","875742","875741","875738","875728","875722","875714","871796","871787","871790","871792","871775","871777","871782","871784","871058","870003","870004","870006","869990","869991","869996","869912","869904","869903","869901","869899","869896","869895","869894","869893","869889","869890","869888","868356","867457","867371","867227","867226","867220","867218","867216","867221","867222","867215","867214","866974","866969","866970","866972","866977","866978","866981","866982","866988","866989","865257","863851","863489","862957","862955","862958","862956","862927","862925","862922","862919","862918","862900","862893","862891","862889","862887","862886","862884","862880","862876","862875","862873","862872","861542","861089","859956","859145","859114","858696","858697","858698","858691","858687","858688","858689","858668","858667","858666","858665","858656","858654","858653","858652","858647","858646","858645","858641","858643","858639","857089","856858","856866","856859","856698","856694","856693","856678","856677","856676","856675","856674","856672","856669","856680","856682","856642","856631","856623","856633","856626","856629","856573","856580","856583","856585","856587","856590","856602","856601","856597","856596","856582","856579","856578","856576","856572","856571","856570","856568","856569","856566","856565","853801","853803","853807","852779","851893","850501","850361","850360","849762","846652","846877","846874","846870","846873","846846","846845","846844","846842","846841","846839","846838","846837","846836","846833","846834","846688","846679","846701","846702","846694","846692","846690","846689","846687","846686","846677","846665","846669","846668","846666","846664","846661","846658","846655","846654","846656","846662","846670","846660","846671","841905","840868","840867","840168","840166","839913","839608","839607","835917","835919","830619","830620","828737","827710","827182","827179","827065","827052","826927","826942","826945","826950","826969","826965","826962","826971","826960","826930","826897","826947","826920","826916","826908","826902","826901","826994","826963","826955","826941","827061","827056","827054","827010","827009","827007","827006","826999","826997","826995","826993","826989","826986","826985","826984","826983","826981","826972","826957","826975","826980","827059","826987","826917","826912","826909","826911","826905","826900","826899","826895","826893","826883","826891","826959","826958","826977","826926","826951","826881","826880","826879","826872","826868","826866","826953","826948","826944","826943","826929","826922","826921","826889","826885","826888","826886","826873","826871","826857","826869","826865","826851","826855","826846","826845","826839","826837","826835","826834","826833","826832","826831","826843","826842","826828","818748","816436","815526","815525","812463","812466","812464","812465","812325","812326","812327","812317","812319","812314","812311","812310","812309","812307","812295","812292","812283","812276","812255","812251","812304","812286","812273","812265","812247","809989","808620","805967","805454","805057","805056","805055","803754","803757","803758","803753","803747","803745","803743","803741","803739","803710","803711","803688","803685","803684","803682","803681","803680","803678","803675","803676","803673","800438","800437","800436","800425","800426","800427","800428","800442","800414","800412","800406","800409","800401","800400","800393","800392","800391","800390","800278","800277","800275","800272","800273","800270","800271","800269","800268","800267","800266","800248","800242","800241","800240","800238","800237","800235","800234","800230","800228","800227","800225","800221","800220","800219","800218","800217","800214","792429","792427","792396","792395","792394","792355","792342","792339","792338","792335","792334","792333","792337","792331","792329","792324","792322","792321","792318","792316","792315","792314","788718","788716","788708","788706","788705","788701","788698","788696","788694","788691","788690","788688","788686","788682","788681","788680","788678","788673","788669","788668","788666","788654","787250","787248","787247","787246","787240","787220","787221","787222","787223","786343","786317","786308","786304","786303","786297","786295","786294","786293","786288","786280","786277","786266","786258","786257","786254","786251","786245","786241","786237","786234","786230","786229","784479","784481","784473","784472","784471","784468","784447","784450","784456","784458","784460","784462","783848","783867","783861","783889","783868","783870","783856","783857","783845","783840","783894","783900","783892","783890","783886","783879","783877","783875","783872","783865","783844","783847","783841","783838","781761","781835","781836","781781","774116","774119","774115","774118","774114","774109","774107","769881","769879","769876","769878","768284","768286","768285","765630","765628","765629","765619","765616","765613","765605","765606","765607","765608","765604","765599","765601","765603","765583","765586","765584","765590","765588","761941","761937","761860","761856","761853","761842","761840","761831","761829","761805","761804","761803","760484","760480","760479","760478","760476","760474","760473","760471","760468","760464","760465","759300","759301","759302","758253","758226","758219","758217","758215","758214","758211","755867","755790","755789","755788","755787","753674","753670","753424","753419","753409","753407","753404","753398","753393","752560","752558","752557","752556","752555","752553","752552","752549","752547","752545","752543","752541","750262","749662","749658","749670","749088","747966","747960","747947","747956","747949","747951","747944","747946","747941","747931","747937","747933","747930","747925","746607","746604","746621","746620","746619","746616","746609","746608","746603","746600","746599","746598","746597","746592","746585","745112","745105","745133","745132","745131","745126","745125","745129","745127","745124","745123","745120","745119","745116","745114","745110","745109","745108","745103","745097","745095","742572","742570","742564","742562","741602","741598","741600","741601","741541","740858","740510","740511","738449","738452","738453","738322","738321","738320","738319","738317","738315","738181","737963","737962","737706","737705","737704","737703","737700","737696","737695","737692","737691","737689","737688","737686","737684","737682","737681","737680","737677","733903","733901","733892","731442","731446","731425","731432","729584","729585","729451","729411","728800","727929","722825","722824","722820","722821","722819","722817","722816","722813","722814","722811","721364","721362","721360","721348","721352","721343","721333","720131","720130","720129","720127","720126","720124","720123","720122","720119","720001","719753","719748","719745","718498","717448","716225","716224","714221","714218","714217","712497","712391","712392","712393","712396","710571","710570","710569","710564","710565","709287","709286","709279","709281","709282","709283","708902","708903","708891","708890","708889","708886","708884","707655","707653","707651","707650","707648","707242","707243","707244","707246","707245","707248","707249","707250","707251","707252","707253","705510","705509","705506","705503","705497","705494","705488","705478","705483","705482","705475","705473","705472","705471","703265","703263","703257","703253","703248","703250","703244","703243","703242","703241","703239","703236","703232","701858","701857","701854","701855","701735","701731","701730","701729","701727","701734","701186","701185","701183","701181","701179","701177","701175","701174","701172","700111","699561","699558","698753","698754","698690","698689","698687","698677","698676","698673","698672","698647","698645","698644","698640","698638","698637","698634","698632","698628","698626","696175","696173","696174","694224","694208","694209","693525","693417","693420","693419","690831","690835","690833","688812","688787","688789","686325","686327","686318","685158","685159","685155","685154","685152","685151","685150","685144","685142","685141","685138","685137","684706","684704","684611","684610","684607","684604","684602","684601","684588","684593","684597","684600","683514","683513","683509","683502","683501","683500","683496","683495","683492","682419","682420","682343","682339","682336","682334","682331","682328","682325","682323","682322","681328","681326","681324","681320","681319","681318","681317","681316","680597","680590","680588","680589","680591","680593","680523","680522","680517","680515","680512","680510","680511","680509","680508","680506","680505","680502","680501","678665","677714","677715","677712","677687","677677","677676","677660","677599","677596","677593","677592","677588","677589","677582","677580","677557","677555","677553","677554","677552","677550","677546","677543","677541","677536","677535","677534","677530","677531","677532","668093","668091","668085","668080","668079","668078","668077","666638","666272","666271","666270","666269","665753","665748","665746","665745","665743","665024","665023","665022","665021","665019","664929","664928","664926","664924","664922","664920","664911","664915","664907","664909","664896","664805","664806","664808","664809","664811","664890","664892","664893","664895","661690","657035","653068","650367","650363","650362","650360","650358","650355","650353","647671","647572","647567","647562","647565","646826","646823","646820","646819","646818","645848","645847","645846","645842","645836","645839","645840","645841","644828","644827","644825","644824","644817","644815","644813","644822","643352","643351","643350","643348","643347","642555","642551","642550","642549","642548","640607","640606","640605","640604","640601","639349","639348","639334","639332","639330","639327","639321","639310","639306","639308","639301","639299","639298","638263","638262","638261","638257","638255","638252","638251","638250","638249","638248","638224","638226","638222","638219","638245","638244","638242","638240","638233","638232","638234","638236","638237","638238","638216","635038","635035","635033","635032","635029","635028","635027","635023","635020","633841","633845","633843","633838","633834","633833","633829","633827","633825","633824","633819","633816","633814","633811","633810","632230","632227","632226","632221","632219","632218","632214","632213","631126","631124","631122","631121","631120","631119","631118","631116","631113","631111","631107","631109","629820","629821","629816","629823","629019","629008","629007","629005","629004","629001","628361","628359","628362","628356","628352","628285","628284","628283","628280","628277","628275","627587","627586","627585","627584","627583","627582","627581","627498","627507","627505","627497","625515","625514","625506","623326","623324","623328","623325","623039","622640","622639","622638","620659","620658","620657","620650","620654","618345","617645","617642","613592","613588","613506","611287","611288","610327","609948","609933","609932","609931","609930","609929","609927","606700","606653","606652","606648","606647","606646","606644","606640","606639","605287","605283","605282","605279","605278","605277","604840","604841","604842","604843","602972","602975","602969","602968","601192","601188","601185","599257","599254","599253","599005","598995","598998","598999","599002","598717","598718","598715","598713","597972","597965","596214","596211","595673","595672","595671","595668","594752","594745","594746","594750","594096","594095","594093","594086","594085","594083","593986","592502","592498","592496","592494","592477","592476","592475","592474","592159","592158","592156","592154","592153","591271","591270","591268","591239","591238","591237","591233","591248","591247","591243","591240","591232","591225","591231","591224","591223","591220","591219","591218","591217","591215","589475","589330","589328","585055","585053","585050","583972","583971","583968","583969","583964","583966","583965","583397","583395","583393","583391","583392","583278","583274","583273","583272","583269","583268","583267","581832","581835","580108","580107","580106","580104","580103","580202","580098","580097","579516","579513","579515","577531","577533","577534","577532","577530","577529","577527","577518","577520","577521","577522","577523","577524","577526","576131","576130","576126","576125","576120","576117","576118","576115","576114","573471","573470","573467","573251","573253","573254","572879","572951","572869","572875","572867","572868","572872","572416","572039","571963","571960","571949","571951","571948","571947","571944","571945","571946","570408","570409","570372","570370","570366","570360","570359","570358","570275","570273","570265","570263","570261","570259","570257","570256","569289","569288","569287","569286","569284","569283","569282","569281","569275","569274","569273","566865","566867","566868","566869","566807","566801","566797","566795","566785","565487","565486","565481","565477","565476","565209","565208","565207","565123","564863","564864","564865","564866","564543","564542","564539","564538","564537","564535","564100","564092","564097","564096","564093","564090","563257","563126","560773","560102","559592","558336","558338","558332","558194","558192","558193","556561","556455","555962","554328","554327","554326","554319","554323","554325","553617","553619","553616","553066","553064","553063","553180","553089","553052","553053","553047","553046","553045","553043","553041","553040","550475","550479","550476","550483","550482","550480","550474","546695","546648","545002","545001","544998","544995","544993","544992","544991","543562","543561","543560","543564","543559","543251","542196","541926","541924","541923","538260","538168","538170","538169","538167","538165","537346","537347","537348","537345","536593","536592","536595","536598","536591","536596","536594","535078","535076","535075","534983","534976","534978","534975","534973","534275","533369","532807","532809","532808","532806","532583","532581","532580","532585","532236","532234","532228","532227","532225","532224","532221","529305","529306","529307","529308","529309","529075","529074","529073","529072","529071","529081","528689","528690","528303","528304","528305","528307","528306","528308","527175","527178","527179","527087","526914","526915","526912","526911","526910","526916","526909","526908","526907","523239","523238","523236","523234","523233","523222","522985","519868","519874","519867","515276","515275","515272","515271","515269","515265","514249","512919","512917","512909","512924","509527","509524","509526","509528","509529","508429","508432","508433","508431","508430","507288","507286","507285","507283","507282","504282","503231","502751","501403","501402","500849","500151","500150","500149","500141","500143","499433","499432","499120","499119","498549","498416","498102","497974","497973","497972","497383","497384","497165","497166","497169","497168","497063","496294","496293","496328","494539","494202","494199","494196","494195","494192","492239","492240","492236","492237","492238","490611","490612","490615","490617","490309","490308","490307","489424","489206","489207","488850","488851","488852","488709","488704","488360","487630","487098","486758","486768","484412","483898","482951","480488","480054","476510","475627","474354","474353","474355","473294","473295","473298","472876","472667","472593","471949","471897","471901","471731","469286","468659","468660","468657","466286","465938","465796","465645","465643","465394","465260","465259","464877","464876","464874","464572","464573","461148","461120","459537","459536","459535","459533","458822","458820","458823","458818","458819","458294","456672","452233","445408","442332","440244","440079","439104","438995","438996","438997","438051","438050","438052","435733","435732","434459","432244","432243","431932","431931","431631","431596","431597","422106","421472","420286","419535","419536","416301","414253","414254","413882","413545","413546","412794","412767","412068","412070","411529","411530","411531","411007","411006","411008","408799","408430","408429","408090","408091","408095","401976","401760","401761","400849","400850","400851","399193","399192","399194","397999","397663","397614","397553","396812","383648","383661","383660","383651","383640","383637","383636","383635","376523","376972","376593","376595","376581","376577","376564","376567","376550","376522","376524","374438","374392","374339","374142","374113","374106","374098","374095","374049","374045","374042","374028","373911"];
const cgGalleires = ["996626","996624","996625","978280","978279","978193","978207","978200","941951","884119","883960","883956","883958","883951","879252","878409","878394","878375","878331","878324","855250","855070","855069","854657","854652","854637","853800","853802","853804","853805","853806","853405","803696","803694","803692","803691","791696","791680","788664","788663","788661","788658","788652","788650","788646","766282","765329","765344","765347","765324","763722","763112","762634","762559","753449","753390","723567","723566","723519","723509","723508","715870","715819","715130","706724","706613","706456","706543","706390","706388","705802","705469","705466","705514","705448","695834","695720","694751","694752","692692","691357","691359","691358","690829","686064","686062","686058","681501","681487","673790","673786","651493","651496","651464","650868","645004","645003","645005","644998","644996","644891","644646","644453","644438","644400","639236","612945","611714","609135","608302","608148","607979","607967","606707","606701","602547","602545","602012","602013","602014","600115","600110","600104","600109","597742","596678","596676","593187","593159","589641","588203","588165","588120","587042","587058","569241","562279","562148","561393","561391","561388","560972","560488","560489","560487","560485","560365","560359","560360","560356","560221","560219","552134","551967","551966","551950","529762","512814","512809","512676","512678","512674","512672","512655","512649","512630","504577","496251","495353","494397","494380","494323","492525","459534","453538","394450","389482","386571","385912","385915","385631","385559","383410","383307","382626","382498","382496","382480","382478","382479","382477","380677","376585","376580","376578","376545","374451","374447","374136","374088","374040","374039"];

const galleriesToSet = normalGalleries;

const fields = [
  'MAX_FILE_SIZE', 
  'PHP_SESSION_UPLOAD_PROGRESS',
  'gname',
  'gname_jpn',
  'gfolder',
  'foldername',
  'publicenable',
  'publiccat',
];
const wipeButton = document.body.insertBefore(document.createElement('button'), document.body.children[0]);
wipeButton.textContent = 'Wipe';
wipeButton.onclick = function() {
  wipeButton.disabled = true;
  doGallery();
};

let galleryIndex = 0;
function doGallery(){
  const url = 'https://upload.e-hentai.org/managegallery?gid=' + galleriesToSet[galleryIndex];
  get(url, function(response) {
    const r = new XMLHttpRequest();
    const data = new FormData();
    fields.forEach(function(field) {
      data.append(field, response.querySelector('[name="' + field + '"]').value);
    });
    data.append('do_save', 1);
    data.append('comment', '');
    data.append('tos', 'on');
    
    r.open('POST' , url);
    r.send(data);
    r.onload = function () {
      if (r.readyState !== 4 || r.status !== 200)
        return;
      wipeButton.textContent = 'done gid ' + galleriesToSet[galleryIndex] + ', gallery ' + galleryIndex + ' / ' + galleriesToSet.length;
      galleryIndex++;
      setTimeout(doGallery, 10000);
    };
  });
};

function get(url, done){
  const r = new XMLHttpRequest();
  r.open('GET', url, true);
  r.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
  r.responseType = 'document';
  r.onload = function () {
    if (r.readyState !== 4)
      return;
    if (r.status === 200){
      done(r.response);
    } else
      wipeButton.textContent += ' Request error: status of ' + r.status;
  };
  r.send();
}