吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1382|回复: 20
收起左侧

[下载转存] 求助,这个网站的音频怎么能下载下来,孩子听!

[复制链接]
wangw050 发表于 2022-5-19 16:37
55吾爱币
本帖最后由 wangw050 于 2022-5-19 17:27 编辑

人民音乐出版社网站的音频,人音教材 (rymusic.art)
https://www.rymusic.art/k12/unit?menuid=peitaoyinxiang&resId=2ff57ed0429111ecaf66fa163e5473a9

之前一直用VSO Downloader 5.1.1.70下载,但最近VSO老是卡死,还自动打开代{过}{滤}理

最佳答案

查看完整内容

用这个 https://wwu.lanzouy.com/il4sV054fyze 旧的忘了配置,有多进程内存溢出……

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

0xSui 发表于 2022-5-19 16:37
用这个
https://wwu.lanzouy.com/il4sV054fyze
旧的忘了配置,有多进程内存溢出……
涛之雨 发表于 2022-5-19 17:52

油猴脚本:https://greasyfork.org/zh-CN/scripts/445224
使用方法:

  1. 安装油猴插件(如果没有安装过的话可以参考我的小破页面
  2. 点击上述链接安装脚本
  3. 打开目标页面(比如楼主帖子中的那个)
  4. 点击需要播放的音频(弹出播放窗口)
  5. 鼠标右击页面任意位置,即可触发下载事件
space2022 发表于 2022-5-19 17:52
space2022 发表于 2022-5-19 17:55
idm就能下载,亲测有效
86570 发表于 2022-5-19 17:56
没有账号无法测试,不过你可以试试IDM
miaolei545 发表于 2022-5-19 21:08
猫传就可以啊
wlnycl 发表于 2022-5-19 21:21
https://www.rymusic.art/awtsupport/play/preview?pid=127c5339-8ed3-4513-ac53-97daee690329

IDM
星星相惜d 发表于 2022-5-19 21:31
F12;network(中文:网络);media(中文:媒体),双击即可下载
0xSui 发表于 2022-5-19 21:44
给你写了个工具,这个页面
https://www.rymusic.art/k12/book?menuid=peitaokejian
全部的课件音乐都自动下载下来,
编译exe,下载直接用,

https://wwu.lanzouy.com/iZQDY054fh4b

另外附上python代码:
[Python] 纯文本查看 复制代码
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import multiprocessing
import os
import random
import sys
import time
import requests
import json
import urllib3
 
urllib3.disable_warnings()
from faker import Faker
 
fake = Faker(locale='zh_CN')
 
 
def get_headers():
    headers = {
        'Content-Type': 'application/json',
        'User-Agent': fake.user_agent()
    }
    return headers
 
 
def get_category(page_num):
    url = "https://www.rymusic.art/dbk12front/Service/PavilionsService/getK12ResourceList"
    payload = json.dumps({
        "pageSize": 12,
        "pageNumber": page_num,
        "resTypeId": [
            "HTML",
            "Disk"
        ],
        "resCategoryIds": [
            "90de89cf205311ecaf66fa163e5473a9"
        ],
        "publishStatus": 1,
        "orderBy": "a.publish_date desc"
    })
    print(f'获取合辑:{url}\n页数:{page_num}')
    return request_method("POST", url, get_headers(), payload, False)
 
 
def get_res_relations(single_res_id, page_num):
    url = "https://www.rymusic.art/dbk12front/Service/PavilionsService/getRYK12ResRelations"
    payload = json.dumps({
        "pageSize": 12,
        "pageNumber": page_num,
        "resId": single_res_id,
        "resTypeId": [
            "Unit"
        ],
        "publishStatus": 1,
        "subResList": 1
    })
    print(f'获取id:{single_res_id}\n课本:{url}\n页数:{page_num}\n')
    return request_method("POST", url, get_headers(), payload, False)
 
 
def get_preview(ref_code, user_id):
    url = "https://www.rymusic.art/dbk12front/Service/PavilionsService/awtSupportResPreview"
    payload = json.dumps({
        "refCode": ref_code,
        "action": "preview",
        "userId": user_id,
        "watermarkText": "人音教材",
        "awtPlayerPreviewUrl": "pc",
        "fileKind": ""
    })
    return request_method("POST", url, get_headers(), payload, False)
 
 
def request_method(request_type, request_url, headers, payload, is_stream):
    with requests.Session() as s:
        status = 0
        count = 0
        while status != 200:
            if count != 0:
                time.sleep(random.randint(1, 3))
            count = count + 1
            try:
                resp = s.request(request_type, request_url, headers=headers, data=payload, timeout=5, stream=is_stream, verify=False)
                status = resp.status_code
            except Exception as e:
                print(f'网络异常{e}')
                time.sleep(random.randint(1, 3))
        if is_stream:
            return resp
        else:
            return resp.json()
 
 
def download_file(download_url, dir_path, file_name):
    r = request_method('GET', download_url, headers='', payload='', is_stream=True)
    # 获取文件下载数据源
    content = r.content
    # 打开文件写入
    file_path = os.path.join(dir_path, file_name)
    with open(file_path, 'wb') as f:
        f.write(content)
 
 
def get_music_info_list(my_info):
    res_id = my_info[0]
    user_id = my_info[1]
    music_info_list_result = []
    is_more = True
    res_page_num = 1
    while is_more:
        res_list_json = get_res_relations(res_id, res_page_num)
        music_list = res_list_json.get('result')
        if len(music_list) > 0:
            for music_info in music_list:
                res_name = music_info.get('resName')
                sub_res_list = music_info.get('subResList')
                for sub_music in sub_res_list:
                    ref_code = sub_music.get('refCode')
                    preview_info = get_preview(ref_code, user_id)
                    download_url = preview_info.get('url')
                    file_name = sub_music.get('resName')
                    file_suffix = sub_music.get('fileType')
                    music_info_list_result.append([res_name, download_url, file_name, file_suffix])
            res_page_num = res_page_num + 1
        else:
            is_more = False
    return music_info_list_result
 
 
def to_download_music(music_info):
    directory = music_info[0]
    download_url = music_info[1]
    file_name = music_info[2]
    file_suffix = music_info[3]
    file_full_name = f'{file_name}.{file_suffix}'
    program_path = os.path.dirname(os.path.realpath(sys.argv[0]))
    res_dir_path = os.path.join(program_path, '下载', directory)
    if not os.path.exists(res_dir_path):
        os.makedirs(res_dir_path)
    if not os.path.isfile(os.path.join(res_dir_path, file_full_name)):
        print(f'开始下载【{file_full_name}】:{download_url}')
        download_file(download_url, res_dir_path, file_full_name)
    else:
        pass
        print('文件已下载,跳过')
 
 
def get_res_ids():
    res_ids_result = []
    category_page_num = 1
    category_has_more = True
    while category_has_more:
        category_rsp = get_category(category_page_num)
        category_list = category_rsp.get('result')
        if len(category_list) > 0:
            print(category_list)
            for item in category_list:
                res_id = item.get('resId')
                res_ids_result.append(res_id)
            category_page_num = category_page_num + 1
        else:
            category_has_more = False
    return res_ids_result
 
 
if __name__ == '__main__':
    my_user_id = "22bae34df412343a82de780597a5154a"
 
    res_ids_result = get_res_ids()
    pool = multiprocessing.Pool(processes=int(multiprocessing.cpu_count() * 0.5))
    res_ids = [[res_id, my_user_id] for res_id in res_ids_result]
    music_info_result = pool.map(get_music_info_list, res_ids)
 
    # music_info_result = []
    # for c in range(0, 1):
    #     res_id = res_ids[c]
    # for res_id in res_ids:
    #     res_id_result = get_music_info_list(res_id)
    #     music_info_result.append(res_id_result)
 
    all_music_urls = []
    # for cc in range(0, 1):
    #     for info in music_info_result[cc]:
    for item in music_info_result:
        for info in item:
            all_music_urls.append(info)
 
    pool.map(to_download_music, all_music_urls)
    # for info in all_music_urls:
    #     to_download_music(info)
    print('下载完成')
返回列表

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

GMT+8, 2025-5-18 20:35

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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