V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
676529483
V2EX  ›  分享创造

最近离职期间,鉴于摸鱼插件不是很好用,就自己写了个,欢迎各位大佬指正

  •  
  •   676529483 · 2021-03-25 16:45:22 +08:00 · 2883 次点击
    这是一个创建于 1100 天前的主题,其中的信息可能已经有所发展或是发生改变。

    灵感来自于Thief-Book-VSCode,但经常出现卡住、编码等问题,就萌生了自己写个插件的想法,二者区别如下:

    区别 Thief-Book-VSCode shadow reader
    大文件 全部加载 部分加载
    支持编码 utf8 GB\Big5\UTF
    支持书量 1 本 多本
    全文搜索 不支持 向后
    在线书籍 不支持 支持并可自定义仓库
    更新时间 2019 2021

    vscode 插件市场搜索shadow reader可得,Github 地址
    欢迎各位大佬试用指正

    10 条回复    2021-04-01 16:32:22 +08:00
    icetea12138
        1
    icetea12138  
       2021-03-26 10:08:04 +08:00
    大佬不考虑考虑 idea 吗?
    isSamle
        2
    isSamle  
       2021-03-26 11:05:01 +08:00
    还以为加载了爬虫哈哈,全网搜索搜不出来
    676529483
        3
    676529483  
    OP
       2021-03-26 11:29:06 +08:00
    @icetea12138 idea 如果需要的人多的话,可以写
    676529483
        4
    676529483  
    OP
       2021-03-26 11:30:17 +08:00
    @isSamle 当前网络没啥书,可以提供一点书籍 pr 或者建议,我可以去爬下
    isSamle
        5
    isSamle  
       2021-03-26 13:44:22 +08:00
    @676529483 可以试下加个书源管理,自由添加一些常用的书源网站,然后用爬虫抓内容下来,搞个缓存到本地可以避免一直爬也行,不同网站的爬虫可能不好清理前端标签,然后版权方面不知道会不会有问题😂,我之前是自己写了个爬虫运行到 cmd 去不过用的本来就是盗版书源 http://note.youdao.com/noteshare?id=11eeac80bf7f4570a087ae850f9ea4e1,如果能整合到一起去直接爬取也是挺好的
    676529483
        6
    676529483  
    OP
       2021-03-26 13:52:05 +08:00
    @isSamle 有具体的项目地址吗?这个我打开是 exe 文件,可能没办法作为扩展发布
    isSamle
        7
    isSamle  
       2021-03-26 15:20:01 +08:00
    @676529483 很简单的 python 脚本

    ----------------------------------------------------------------------------------------------------------------------------------------------
    #coding=utf-8
    import requests
    import re
    print('数据来源于 https://www.biqubao.com/ 如需到此网更新书籍')
    bookurl = input('该本小说网站(直接回车自动跳转一本):')
    if bookurl == '':
    bookurl = 'https://www.biqubao.com/book/34203/'
    homeurl = 'https://www.biqubao.com/'
    A = requests.get(bookurl).content.decode('gb2312')
    B = re.split(r'<dd><a href=|</a></dd>',A)
    PAGE = []
    for html in B:
    if 'html' in html and '\n' not in html:
    PAGE.append(html)

    def page_new(P):
    PP=int(P)-1
    ok = re.split(r'"/|">',PAGE[PP])
    oneurl = homeurl+ok[1]
    print('_'*70)
    print('|'+ok[2]+oneurl)
    D = requests.get(oneurl).content.decode('gb2312')
    E = re.split(r'<br />|&nbsp;&nbsp;&nbsp;&nbsp;|</div>|<h1>|</h1>|\n',D)
    for text in E:
    if text !='' and '<a href=' not in text:
    really = 0
    for i in text:
    if '\u4e00' <= i <= '\u9fff':
    really +=1
    if really > 0:
    print('|'+text)
    print('——'*15)

    textpage = 0
    if __name__ == '__main__':
    while True:
    old = textpage
    textpage = input('跳转书页|回车下一章 next>>')
    if textpage == '':
    textpage = int(old) +1
    page_new(textpage)
    676529483
        8
    676529483  
    OP
       2021-03-26 22:48:44 +08:00
    @isSamle 这个笔趣网爬取难度不大,版权方面确实不清楚,才不敢随便搞。我去参考下其他插件
    676529483
        9
    676529483  
    OP
       2021-04-01 14:49:34 +08:00
    @isSamle 我刚刚更新了版本,已经支持笔趣阁了,欢迎更新试用,多提意见
    isSamle
        10
    isSamle  
       2021-04-01 16:32:22 +08:00
    @676529483 好的哈哈哈,非常棒,我看看
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2868 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:37 · PVG 19:37 · LAX 04:37 · JFK 07:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.