Ejemplo n.º 1
0
def saveIndex(istr):
    time.sleep(0.1)
    with print_lock:
        for gentle in [0, 1]:
            try:
                url = prefix1 + "assets/leader/job_change/" + istr + str(
                    gentle) + "_01.png"
                if (download.saveImg(url, groupdir[1])):
                    if (SAVELINK):
                        with open(grouplink[1], "a") as linkfile:
                            linkfile.write(url + "\n")
            except:
                pass
            for word in ['a', 'b', 'c', 'd', 'e']:
                try:
                    url = prefix1 + "cjs/job_release_" + istr[0:6] + "_" + str(
                        gentle) + "_" + word + ".png"
                    if (download.saveImg(url, groupdir[2])):
                        if (SAVELINK):
                            with open(grouplink[2], "a") as linkfile:
                                linkfile.write(url + "\n")
                except:
                    pass
            try:
                url = prefix1 + "assets/leader/my/" + istr + str(
                    gentle) + "_01.png"
                if (download.saveImg(url, groupdir[0])):
                    if (SAVELINK):
                        with open(grouplink[0], "a") as linkfile:
                            linkfile.write(url + "\n")
            except:
                pass
Ejemplo n.º 2
0
def saveIndex(imgData):
    time.sleep(0.1)
    with print_lock:
        imgName = "10" + groupstr[imgData.groupid] + str(
            imgData.id).zfill(3) + "00"
        iddir = imgData.groupid // 10
        dir = groupdir[iddir]
        count = 0
        try:
            url = prefix1 + "m/" + imgName + ".jpg"
            if (download.saveImg(url, dir + "\\m")):
                count += 1
                if (SAVELINK):
                    #print(grouplink[imgData.groupid])
                    #print(imgData.url)
                    with open(grouplink[iddir], "a") as linkfile:
                        linkfile.write(url + "\n")
        except:
            pass

        try:
            url = prefix1 + "b/" + imgName + ".png"
            if (download.saveImg(url, dir + "\\b")):
                count += 1
                if (SAVELINK):
                    #print(grouplink[imgData.groupid])
                    #print(imgData.url)
                    with open(grouplink[iddir], "a") as linkfile:
                        linkfile.write(url + "\n")
        except:
            pass

        try:
            url = prefix1 + "ls/" + imgName + ".jpg"
            if (download.saveImg(url, dir + "\\ls")):
                count += 1
                if (SAVELINK):
                    #print(grouplink[imgData.groupid])
                    #print(imgData.url)
                    with open(grouplink[iddir], "a") as linkfile:
                        linkfile.write(url + "\n")
        except:
            pass
        #update logic
        if (count > 0):
            if (imgData.id > groupstack[imgData.groupid]):
                print("update list " + groupdir[iddir])
                groupstack[imgData.groupid] += groupstep[imgData.groupid]
                simglist = []
                simglist = wpimglist(imgData.groupid)
                for iimg in simglist:
                    data_q.put(iimg)
                simglist.clear()
            if (imgData.id > grouptop[imgData.groupid]):
                grouptop[imgData.groupid] = imgData.id
Ejemplo n.º 3
0
def saveIndex(imgData):
    time.sleep(0.1)
    with print_lock:
        imgName = groupstr[imgData.groupid] + str(imgData.id).zfill(4) + "000"
        dir = groupdir[imgData.groupid]
        count = 0
        try:
            url = prefix1 + imgName + ".png"
            #print(url)
            if (download.saveImg(url, dir)):
                count += 1
                if (SAVELINK):
                    with open(grouplink[imgData.groupid], "a") as linkfile:
                        linkfile.write(url + "\n")
        except:
            pass

        #update logic
        if (count > 0):
            if (imgData.id > groupstack[imgData.groupid]):
                print("update list " + groupdir[imgData.groupid])
                groupstack[imgData.groupid] += groupstep[imgData.groupid]
                simglist = []
                simglist = smmimglist(imgData.groupid)
                for iimg in simglist:
                    data_q.put(iimg)
                simglist.clear()
            if (imgData.id > grouptop[imgData.groupid]):
                grouptop[imgData.groupid] = imgData.id
Ejemplo n.º 4
0
def saveIndex(imgData):
    time.sleep(0.1)
    global groupstack
    global grouptop
    global groupdir
    with print_lock:
        imgName = str(imgData.id)
        dir = groupdir
        count = 0
        try:
            url = prefix1 + imgName + ".jpg"
            #print(url)
            if (download.saveImg(url, dir)):
                count += 1
                if (SAVELINK):
                    with open(grouplink[imgData.groupid], "a") as linkfile:
                        linkfile.write(url + "\n")
        except:
            pass

        #update logic
        if (count > 0):
            if (imgData.id > groupstack):
                print("update list " + groupdir)
                groupstack += groupstep
                simglist = []
                simglist = bgimglist(imgData.groupid)
                for iimg in simglist:
                    data_q.put(iimg)
                simglist.clear()
            if (imgData.id > grouptop):
                grouptop = imgData.id
Ejemplo n.º 5
0
def saveIndex(imgData):
    time.sleep(0.1)
    with print_lock:
        for iexp in explist:
            dir = groupdir[0]
            count = 0
            try:
                url = prefix1 + imgData + iexp + ".png"
                if (download.saveImg(url, dir)):
                    count += 1
                    if (SAVELINK):
                        #print(grouplink[imgData.groupid])
                        #print(imgData.url)
                        with open(grouplink[0], "a") as linkfile:
                            linkfile.write(url + "\n")
            except:
                pass
Ejemplo n.º 6
0
def saveIndex(imgData):
    time.sleep(0.1)
    with print_lock:
        imgName = str(imgData.id).zfill(4) + "000"
        gid = imgData.groupid
        count = 0
        # zoom
        for isuf in suflist:
            try:
                url = prefix1 + groupstr[10 + gid] + imgName + isuf + ".png"
                if (download.saveImg(url, groupdir[10 + gid])):
                    count += 1
                    if (SAVELINK):
                        #print(grouplink[imgData.groupid])
                        #print(imgData.url)
                        with open(grouplink[10 + gid], "a") as linkfile:
                            linkfile.write(url + "\n")
            except:
                pass
        '''
Ejemplo n.º 7
0
def saveIndex(imgData):
    time.sleep(0.1)
    with print_lock:
        imgName = str(imgData.id).zfill(4) + "000"
        gid = imgData.groupid
        count = 0
        # book
        for isuf in suflist:
            try:
                url = prefix1 + groupstr[gid] + imgName + isuf + ".png"
                if (download.saveImg(url, groupdir[gid])):
                    count += 1
                    if (SAVELINK):
                        #print(grouplink[imgData.groupid])
                        #print(imgData.url)
                        with open(grouplink[gid], "a") as linkfile:
                            linkfile.write(url + "\n")
            except:
                pass
        # zoom
        for isuf in suflist:
            try:
                url = prefix1 + groupstr[10 + gid] + imgName + isuf + ".png"
                if (download.saveImg(url, groupdir[10 + gid])):
                    count += 1
                    if (SAVELINK):
                        #print(grouplink[imgData.groupid])
                        #print(imgData.url)
                        with open(grouplink[10 + gid], "a") as linkfile:
                            linkfile.write(url + "\n")
            except:
                pass
        # quest
        if (gid != 3):
            for iexp in explist:
                try:
                    url = prefix1 + groupstr[5 + gid] + imgName + iexp + ".png"
                    if (download.saveImg(url, groupdir[5 + gid])):
                        count += 1
                        if (SAVELINK):
                            # print(grouplink[imgData.groupid])
                            # print(imgData.url)
                            with open(grouplink[5 + gid], "a") as linkfile:
                                linkfile.write(url + "\n")
                except:
                    pass
        # cover
        if (gid != 4):
            for isuf in suflist:
                try:
                    url = prefix1 + groupstr[15 +
                                             gid] + imgName + isuf + ".png"
                    if (download.saveImg(url, groupdir[15 + gid])):
                        count += 1
                        if (SAVELINK):
                            # print(grouplink[imgData.groupid])
                            # print(imgData.url)
                            with open(grouplink[15 + gid], "a") as linkfile:
                                linkfile.write(url + "\n")
                except:
                    pass

        #update logic
        if (count > 0):
            if (imgData.id > groupstack[gid]):
                print("update list " + groupdir[gid])
                groupstack[gid] += groupstep[gid]
                print(gid)
                print(groupstack[gid])
                simglist = []
                simglist = imglist(gid)
                for iimg in simglist:
                    data_q.put(iimg)
                simglist.clear()
            if (imgData.id > grouptop[gid]):
                grouptop[gid] = imgData.id