吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 24824|回复: 124
收起左侧

[原创工具] 幻听网有声小说下载

  [复制链接]
naiwenmoer1 发表于 2020-2-10 12:01
本帖最后由 naiwenmoer1 于 2020-2-10 13:07 编辑

声明:本软件下载内容均为幻听网免费有声小说资源,软件仅供娱乐,版权所有归幻听网所有,请在下载后24小时内删除!!!如有违规,请管理删除,谢谢!
最近在家躺久了,无聊看到悬赏问答区有人求有声小说资源,但是在网页上听感觉好麻烦。索性起床写个下载器,欢迎大家使用,软件e语言编写,介意勿下!
软件调用IDM下载,请在使用前将CIDM.dll文件放到C:\Windows\System32(32位)或C:\Windows\SysWOW64(64位)

下载前请按下图配置IDM,不然弹窗会让你怀疑人生,哈哈!

哈勃分析结果:


ezgif.com-video-to-gif.gif

幻听网有声小说下载.zip

703.89 KB, 下载次数: 1166, 下载积分: 吾爱币 -2 CB

免费评分

参与人数 16吾爱币 +18 热心值 +15 收起 理由
牛皮闪闪ok + 1 + 1 谢谢@Thanks!
lorren2008 + 1 + 1 已经处理,感谢您对吾爱破解论坛的支持!
寒兰一梦 + 1 我很赞同!
hgfdsabnm + 1 热心回复!
newtypezxh + 1 + 1 谢谢@Thanks!
周董JJ特大号 + 1 + 1 谢谢@Thanks!
dolphin630 + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
bighuasheng + 1 + 1 谢谢@Thanks!
AlwaysTT + 1 + 1 谢谢@Thanks!
369963 + 1 真乃热心大神是也,太好用了,谢谢
西门吹牛 + 1 + 1 支持,希望出一些其他网站的
Asy_少洋 + 1 + 1 支持,希望可以出其他站点的下载器。
xue1987 + 1 + 1 谢谢@Thanks!
bianchi + 1 mark!
lyqjqly + 1 + 1 我很赞同!
风之暇想 + 6 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

zzm.note 发表于 2020-2-11 17:59
本帖最后由 zzm.note 于 2020-2-11 18:00 编辑

很久之前自己写了个python的,现在不知道还行不行。
只是批量获取书的下载链接,然后自己复制到下载软件中批量下载。

[Python] 纯文本查看 复制代码
import requests
import random
import re
import os
import time
from bs4 import BeautifulSoup


class Ting89:
    """
    输入书ID,爬取幻听网下载地址
    """

    def __init__(self):
        self.base_url = 'http://www.ting89.com'

    @staticmethod
    def get_headers():
        """
        返回一个随机的请求头 headers
        :return:
        """
        # 各种PC端
        user_agent_list_2 = [
            # Opera
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60",
            "Opera/8.0 (Windows NT 5.1; U; en)",
            "Mozilla/5.0 (Windows NT 5.1; U; en; rv:1.8.1) Gecko/20061208 Firefox/2.0.0 Opera 9.50",
            "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.50",
            # Firefox
            "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0",
            "Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10",
            # Safari
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2",
            # chrome
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36",
            "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11",
            "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16",
            # 360
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36",
            "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
            # 淘宝浏览器
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/2.0 Safari/536.11",
            # 猎豹浏览器
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.71 Safari/537.1 LBBROWSER",
            "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; LBBROWSER)",
            "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E; LBBROWSER)",
            # QQ浏览器
            "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; QQBrowser/7.0.3698.400)",
            "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)",
            # sogou浏览器
            "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.84 Safari/535.11 SE 2.X MetaSr 1.0",
            "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; SE 2.X MetaSr 1.0)",
            # maxthon浏览器
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.3.4000 Chrome/30.0.1599.101 Safari/537.36",
            # UC浏览器
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 UBrowser/4.0.3214.0 Safari/537.36",
        ]
        # 各种移动端
        user_agent_list_3 = [
            # IPhone
            "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5",
            # IPod
            "Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5",
            # IPAD
            "Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; zh-cn) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
            "Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5",
            # Android
            "Mozilla/5.0 (Linux; U; Android 2.2.1; zh-cn; HTC_Wildfire_A3333 Build/FRG83D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
            "Mozilla/5.0 (Linux; U; Android 2.3.7; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
            # QQ浏览器 Android版本
            "MQQBrowser/26 Mozilla/5.0 (Linux; U; Android 2.3.7; zh-cn; MB200 Build/GRJ22; CyanogenMod-7) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
            # Android Opera Mobile
            "Opera/9.80 (Android 2.3.4; Linux; Opera Mobi/build-1107180945; U; en-GB) Presto/2.8.149 Version/11.10",
            # Android Pad Moto Xoom
            "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
            # BlackBerry
            "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.337 Mobile Safari/534.1+",
            # WebOS HP Touchpad
            "Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 TouchPad/1.0",
            # Nokia N97
            "Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/20.0.019; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.18124",
            # Windows Phone Mango
            "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; HTC; Titan)",
            # UC浏览器
            "UCWEB7.0.2.37/28/999",
            "NOKIA5700/ UCWEB7.0.2.37/28/999",
            # UCOpenwave
            "Openwave/ UCWEB7.0.2.37/28/999",
            # UC Opera
            "Mozilla/4.0 (compatible; MSIE 6.0; ) Opera/UCWEB7.0.2.37/28/999"
        ]
        # 一部分 PC端的
        user_agent_list_1 = [
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1",
            "Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11",
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6",
            "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6",
            "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/19.77.34.5 Safari/537.1",
            "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5",
            "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.36 Safari/536.5",
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3",
            "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3",
            "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3",
            "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1062.0 Safari/536.3",
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1062.0 Safari/536.3",
            "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3",
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3",
            "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3",
            "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.0 Safari/536.3",
            "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.24 (KHTML, like Gecko) Chrome/19.0.1055.1 Safari/535.24",
            "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/535.24 (KHTML, like Gecko) Chrome/19.0.1055.1 Safari/535.24"
        ]
        user_agent_list = user_agent_list_1 + user_agent_list_2 + user_agent_list_3
        UserAgent = random.choice(user_agent_list)
        headers = {'User-Agent': UserAgent}
        return headers

    def get_down_url(self, book_id):
        """
        获取下载链接
        :param book_id: 书ID
        :return: 下载链接的数组形式
        """
        book_name = ''
        total_down_url = []
        full_url = self.base_url + '/books/' + book_id + '.html'
        try:
            resp = requests.get(full_url, headers=Ting89.get_headers(), timeout=30)
            resp.encoding = 'gbk'
            if resp.status_code == 200:
                soup = BeautifulSoup(resp.text, 'lxml')
                book_name = soup.select('body > div.wrapper > div.contentleft > div:nth-child(1) > div > div > ul > '
                                        'li > center > h1')[0].next_element
                select = soup.select('body > div.wrapper > div.contentleft > div:nth-child(4) > div > ul > li')
                for i in select:
                    # time.sleep(random.uniform(1.1, 3.1))
                    time.sleep(random.random())
                    try:
                        resp_down = requests.get(self.base_url + i.a['href'], headers=Ting89.get_headers(), timeout=30)
                        resp_down.encoding = 'gbk'
                        if resp_down.status_code == 200:
                            soup_down = BeautifulSoup(resp_down.text, 'lxml')
                            select_down = soup_down.iframe['src']
                            pat = re.compile('(?<=url=).*(mp3)')
                            decstr = re.search(pat, select_down)
                            print(decstr.group(0))
                            total_down_url.append(decstr.group(0))
                        else:
                            print(f'请求{self.base_url + select[60].a["href"]}报错!')
                    except requests.exceptions.RequestException as e:
                        print(f'=======获取{i.a.string}的下载链接错误: {e}')
                        total_down_url.append(f'=======获取{i.a.string}的下载链接错误:{e}')
            else:
                print(f'请求{full_url}报错!')
        except requests.exceptions.RequestException as e:
            print(f'=======请求{full_url}报错:\n'
                  f'{e}')
        return book_name, total_down_url

    @staticmethod
    def write_txt(file_path, urls):
        """
        把下载链接写入文件中
        :param file_path: 文件保存路径
        :param urls: 下载链接数组
        :return:
        """
        with open(file_path, 'w') as f:
            for i in urls:
                f.write(i + '\n')


if __name__ == '__main__':
    bookId = input('请输入书名ID:')
    base_path = input('请输入保存路径:')
    # bookId = '9668'
    # base_path = '/Users/XXX/Downloads'
    ting = Ting89()
    name, down_url = ting.get_down_url(bookId)
    full_path = os.path.join(base_path, name + '.txt')
    ting.write_txt(full_path, down_url)
belison 发表于 2020-3-2 21:39
 楼主| naiwenmoer1 发表于 2020-2-10 12:11
发完贴子才看到,论坛以前有人发过类似软件,只是没有调用IDM,请管理删帖吧。
fan2359 发表于 2020-2-10 12:34
好东西,大力支持!!!!!!
酷酷的杰gg 发表于 2020-2-10 12:41
大哥大哥为啥我只能下载一集而不是一直下载
 楼主| naiwenmoer1 发表于 2020-2-10 12:48
酷酷的杰gg 发表于 2020-2-10 12:41
大哥大哥为啥我只能下载一集而不是一直下载

IDM设置问题,所有任务添加到idm了没?
 楼主| naiwenmoer1 发表于 2020-2-10 12:48
fan2359 发表于 2020-2-10 12:34
好东西,大力支持!!!!!!

记得免费的评分和爱心点一点
s98 发表于 2020-2-10 12:53
好的,刚好找到了
流浪星空 发表于 2020-2-10 13:19
感谢分享!
ladiosfei 发表于 2020-2-10 13:20
如果资源够多够精这实在是个好东西,感谢了
dengqigang12 发表于 2020-2-10 13:25
感谢分享,宅在家的必备。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-25 04:44

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表