Pxer icon indicating copy to clipboard operation
Pxer copied to clipboard

新增作品重命名功能

Open weikeet opened this issue 7 years ago • 10 comments

使用的系统、浏览器、Pxer版本

  • macSierra10.12.4
  • Google Chrome 60.0.3080.5(正式版本)dev (64 位)
  • Pxer开发版 7.0.4

建议

  • 是否可以在爬去的时候重命名一下作品名字,比如改成“作者_作品ID_PX”,X是0123……,能加上作品名称也不错,但是加上作品名称比较乱。还是作者+作品ID比较好。

weikeet avatar May 03 '17 04:05 weikeet

确实是一个需求,但是实现起来没办法原生实现,等插件管理部分开发完以插件的方式实现吧

pea3nut avatar May 03 '17 05:05 pea3nut

= =不是用H5的下载就行了么。。为什么又要插件了。。

SetoKaiba avatar May 07 '17 16:05 SetoKaiba

Pxer只提供下载URL,没有明白重命名指什么?

eternal-flame-AD avatar Jul 13 '18 13:07 eternal-flame-AD

@eternal-flame-AD 非开发者其实很难分清各个程序的职能边界。

如果Pxer提供下载支持,确实是可以做的。我能想到的有3种办法:

  1. 用blob浏览器下载,类似于仙尊那样
  2. 把Pxer迁移到WebExtensions,这样可以拿到浏览器的下载接口
  3. 提供本地下载工具

在可见的未来,还没有计划

pea3nut avatar Jul 13 '18 13:07 pea3nut

那是不是可以理解为duplicate of #21 可以关闭?

eternal-flame-AD avatar Jul 13 '18 15:07 eternal-flame-AD

我觉得只是有一部分重叠但不是全部, #21 是这个issue的其中一个的解决思路

pea3nut avatar Jul 14 '18 03:07 pea3nut

我觉得只是有一部分重叠但不是全部, #21 是这个issue的其中一个的解决思路

pea3nut avatar Jul 14 '18 03:07 pea3nut

我觉得可以生成一个重命名脚本(bat or bash)用户自己执行就好了

另外个人需要的命名规则是 YYYYMMDD {title},可能需要提供多种模式了

ZSkycat avatar Mar 28 '19 03:03 ZSkycat

这是我自己制作的分类脚本,不过目前只能根据id自动分类,可以参考一下

# -*- coding: utf-8 -*-
import os
import re
import shutil

files = os.listdir('.')
images = []

for i in files:
    reg = re.match(r'^([0-9]+)_p([0-9]+)\.(png|jpg|gif)$', i, re.IGNORECASE)
    if reg is not None:
        if not os.path.isdir(reg.group(1)):
            os.mkdir(reg.group(1))
            print('Maked dir %s' % reg.group(1))
        else:
            print('Ignore dir %s' % reg.group(1))

        if not os.path.exists(reg.group(1) + '/' + reg.group(2) + '.' + reg.group(3)):
            shutil.move(reg.group(0), reg.group(1) + '/' + reg.group(2) + '.' + reg.group(3))
            print('Moved file %s -> %s' % (reg.group(0), reg.group(1) + '/' + reg.group(2) + '.' + reg.group(3)))
        else:
            print('Exists file %s' % reg.group(1))
            
    else:
        print('Ignore file %s' % i)

print('End')

Yang-qwq avatar Jun 25 '23 11:06 Yang-qwq

这是我自己制作的分类脚本,不过目前只能根据id自动分类,可以参考一下

# -*- coding: utf-8 -*-
import os
import re
import shutil

files = os.listdir('.')
images = []

for i in files:
    reg = re.match(r'^([0-9]+)_p([0-9]+)\.(png|jpg|gif)$', i, re.IGNORECASE)
    if reg is not None:
        if not os.path.isdir(reg.group(1)):
            os.mkdir(reg.group(1))
            print('Maked dir %s' % reg.group(1))
        else:
            print('Ignore dir %s' % reg.group(1))

        if not os.path.exists(reg.group(1) + '/' + reg.group(2) + '.' + reg.group(3)):
            shutil.move(reg.group(0), reg.group(1) + '/' + reg.group(2) + '.' + reg.group(3))
            print('Moved file %s -> %s' % (reg.group(0), reg.group(1) + '/' + reg.group(2) + '.' + reg.group(3)))
        else:
            print('Exists file %s' % reg.group(1))
            
    else:
        print('Ignore file %s' % i)

print('End')

好是好,可惜没办法浏览器脚本实现

pea3nut avatar Jul 08 '23 11:07 pea3nut