吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 25271|回复: 287
上一主题 下一主题
收起左侧

[Python 原创] WINRAR自动查找官方最新中文无广告版并下载脚本

    [复制链接]
跳转到指定楼层
楼主
shieep 发表于 2025-1-9 23:48 回帖奖励
本帖最后由 shieep 于 2025-1-10 01:00 编辑

官方有广告版下载链接: https://www.rarlab.com/rar/winrar-x64-701sc.exe
官网无广告版地址为https://www.win-ra
[Python] 纯文本查看 复制代码
import requests
import re
from datetime import datetime, timedelta

# 目标网页 URL
url = 'https://www.rarlab.com/'

# 发送 HTTP GET 请求获取网页内容
response = requests.get(url)
response.raise_for_status()  # 确保请求成功

# 使用正则表达式查找连接文字为“Chinese Simplified”的下载链接
pattern = r'href="(/rar/winrar-x64-[^"]+sc\.exe)"[^>]*>Chinese Simplified<'
match = re.search(pattern, response.text, re.IGNORECASE)

if match:
    # 补全下载链接
    download_link = f"https://www.rarlab.com{match.group(1)}"
    print(f"找到下载链接: {download_link}")
    
    # 发送 HTTP HEAD 请求获取文件的服务器时间
    head_response = requests.head(download_link)
    server_date = head_response.headers.get('Last-Modified')
    
    if server_date:
        # 将服务器时间转换为 datetime 对象
        server_date = datetime.strptime(server_date, '%a, %d %b %Y %H:%M:%S %Z')
        print(f"文件在服务器的时间: {server_date}")
        
        # 日期往前推一个月
        target_date = server_date - timedelta(days=30)
        file_name = match.group(1).split('/')[-1]
        
        for i in range(60):  # 最多加60天
            # 生成新的日期格式
            new_date_str = target_date.strftime('%Y%m%d')
            new_url_x64 = f"https://www.win-rar.com/fileadmin/winrar-versions/sc/sc{new_date_str}/wrr/{file_name}"
            new_url_x32 = new_url_x64.replace('x64', 'x32')
            print(f"尝试访问: {new_url_x64}")
            
            # 发送 HTTP HEAD 请求测试 x64 文件是否存在
            head_response_x64 = requests.head(new_url_x64)
            if head_response_x64.status_code == 200:
                print(f"x64 文件存在: {new_url_x64}")
                
                # 下载 x64 文件
                download_response_x64 = requests.get(new_url_x64)
                download_response_x64.raise_for_status()  # 确保下载成功
                
                # 保存 x64 文件到当前目录
                with open(file_name, 'wb') as file:
                    file.write(download_response_x64.content)
                print(f"x64 文件已下载到当前目录: {file_name}")
                
                # 发送 HTTP HEAD 请求测试 x32 文件是否存在
                head_response_x32 = requests.head(new_url_x32)
                if head_response_x32.status_code == 200:
                    print(f"x32 文件存在: {new_url_x32}")
                    
                    # 下载 x32 文件
                    download_response_x32 = requests.get(new_url_x32)
                    download_response_x32.raise_for_status()  # 确保下载成功
                    
                    # 保存 x32 文件到当前目录
                    file_name_x32 = file_name.replace('x64', 'x32')
                    with open(file_name_x32, 'wb') as file:
                        file.write(download_response_x32.content)
                    print(f"x32 文件已下载到当前目录: {file_name_x32}")
                else:
                    print(f"x32 文件不存在: {new_url_x32}")
                break
            else:
                print(f"文件不存在: {new_url_x64}")
                target_date += timedelta(days=1)
    else:
        print("无法获取文件的服务器时间")
else:
    print("未找到连接文字为'Chinese Simplified'的下载链接")
r.com/fileadmi ... inrar-x64-701sc.exe

我们要无广告版本,需要尝试不同的时间来获取正确下载地址,人工尝试慢,然后可以用下面的脚本来尝试。

运行结果如下:
找到下载链接: https://www.rarlab.com/rar/winrar-x64-701sc.exe
文件在服务器的时间: 2024-06-18 11:50:10
尝试访问: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
文件不存在: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
尝试访问: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
文件不存在: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
尝试访问: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
文件不存在: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
尝试访问: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
文件不存在: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
尝试访问: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
文件不存在: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
尝试访问: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
文件不存在: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
尝试访问: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
文件不存在: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
尝试访问: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
文件不存在: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
尝试访问: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
文件不存在: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
尝试访问: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
x64 文件存在: https://www.win-rar.com/fileadmi ... inrar-x64-701sc.exe
x64 文件已下载到当前目录: winrar-x64-701sc.exe
x32 文件存在: https://www.win-rar.com/fileadmi ... inrar-x32-701sc.exe
x32 文件已下载到当前目录: winrar-x32-701sc.exe
找到最新版本,已下载 x32 和 x64 文件。
如果已经有最新版本运行结果如下:
===================== RESTART: D:\系统\WinRAR\getWinRARChs.py ====================
版本已经最新,无需重新下载。
需要配图才能发布

wechat_2025-01-09_234757_749.png (6.99 KB, 下载次数: 119)

wechat_2025-01-09_234757_749.png

wechat_2025-01-09_234739_597.png (39.09 KB, 下载次数: 23)

wechat_2025-01-09_234739_597.png

wechat_2025-01-09_234727_697.png (41.21 KB, 下载次数: 5)

wechat_2025-01-09_234727_697.png

免费评分

参与人数 104吾爱币 +97 热心值 +95 收起 理由
hfxiang + 2 + 1 我很赞同!
m-chris + 1 + 1 鼓励转贴优秀软件安全工具和文档!
Hegemonism + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
1903291 + 1 + 1 鼓励转贴优秀软件安全工具和文档!
lujun993976 + 1 + 1 谢谢@Thanks!
ultraesp + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
nukin + 1 + 1 谢谢@Thanks!
0angel0 + 1 + 1 谢谢@Thanks!
zhai0122 + 1 我很赞同!
星辰潋羽 + 1 + 1 我很赞同!
wojiaosj2024 + 1 + 1 谢谢@Thanks!
bdcpc + 1 + 1 用心讨论,共获提升!
lishunxin + 1 谢谢@Thanks!
bb4tc + 1 我很赞同!
kiejiet + 1 我很赞同!
lottykwok + 1 + 1 谢谢@Thanks!
tomanpj + 1 + 1 谢谢@Thanks!
wzvideni + 1 + 1 热心回复!
2595453382 + 1 + 1 谢谢@Thanks!
黑丝短裙 + 1 我很赞同!
小粑666 + 1 + 1 谢谢@Thanks!
MikoShiro + 1 谢谢@Thanks!
jsyczxyh + 1 热心回复!
清风初至 + 1 + 1 热心回复!
yp17792351859 + 1 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
fhyz + 1 + 1 谢谢@Thanks!
tvrcfdfe + 1 + 1 我很赞同!
dzc999 + 1 + 1 谢谢@Thanks!
nickcid2002 + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
ag129 + 1 + 1 热心回复!
xgl520shop + 2 + 1 谢谢@Thanks!
gamewfj + 1 + 1 用心讨论,共获提升!
leolcg + 1 + 1 谢谢@Thanks!
jinwei201 + 1 这个厉害了
策士 + 1 + 1 鼓励转贴优秀软件安全工具和文档!
huangle051 + 1 + 1 谢谢@Thanks!
love66550 + 1 + 1 收藏了
piraya + 1 + 1 我很赞同!
yjjgogjscy + 1 + 1 我很赞同!
bugof52pj + 1 谢谢@Thanks!
shmily1452 + 1 谢谢@Thanks!
corleoneYellow + 1 + 1 我很赞同!
klmytwb + 1 + 1 谢谢@Thanks!
iceboy800 + 1 + 1 谢谢@Thanks!
hjsm + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
lhn469787992 + 1 + 1 我很赞同!
sdycx92 + 1 + 1 谢谢@Thanks!
flibin + 1 + 1 谢谢@Thanks!
mafei3709 + 1 + 1 谢谢@Thanks!
zql136 + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
满脑子不洁幻想 + 1 + 1 我很赞同!
xfsan + 1 + 1 已经处理,感谢您对吾爱破解论坛的支持!
wenbo998 + 1 + 1 我很赞同!
注册个id + 1 + 1 用心讨论,共获提升!
1099939197 + 1 + 1 不错不错
skywalkicer + 1 + 1 谢谢@Thanks!
xinye6768 + 1 谢谢@Thanks!
yygfml + 1 + 1 我很赞同!
swsjjdcs + 1 + 1 我很赞同!
yx69 + 1 + 1 我很赞同!
A75971 + 1 + 1 谢谢@Thanks!
lyricsaya + 1 + 1 热心回复!
ryxwsj + 1 + 1 我很赞同!
tek2y + 1 谢谢@Thanks!
black911 + 1 + 1 我很赞同!
catoo1 + 1 谢谢@Thanks!
起名想半年 + 1 + 1 我很赞同!
kka950 + 1 + 1 谢谢@Thanks!
confiant + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
degas8888 + 1 + 1 热心回复!
superwager + 1 谢谢@Thanks!
Issacclark1 + 1 谢谢@Thanks!
精妹 + 1 我很赞同!
jjyy00001 + 1 + 1 谢谢@Thanks!
qdyb + 1 + 1 谢谢@Thanks!
wwyyttao + 1 + 1 鼓励转贴优秀软件安全工具和文档!
qzhl920 + 1 + 1 我很赞同!
guoruihotel + 1 + 1 谢谢@Thanks!
lycwqhpj + 1 + 1 我很赞同!
xxxart + 1 + 1 谢谢@Thanks!
ljb2100996 + 1 + 1 谢谢@Thanks!
zhangdexi + 1 + 1 用心讨论,共获提升!
wlpkcheng + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
wkxq + 3 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
小小羽 + 1 + 1 时间倒着往前推更合适
LiveOnLove + 1 + 1 谢谢@Thanks!
笑谈曾经 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
bpzm1987 + 1 + 1 我很赞同!
suptt + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
qsj521521 + 1 + 1 谢谢@Thanks!
cxqdly + 1 + 1 热心回复!
Tusimple + 1 + 1 热心回复!
sototo + 1 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
简乐 + 1 + 1 谢谢@Thanks!
just-a-kiss + 1 我很赞同!
liyitong + 1 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
过饭蛮煞婆 + 1 + 1 谢谢@Thanks!
511bobo + 1 + 1 鼓励转贴优秀软件安全工具和文档!
紫色情愫 + 1 + 1 鼓励转贴优秀软件安全工具和文档!
skanrmty + 1 谢谢@Thanks!

查看全部评分

本帖被以下淘专辑推荐:

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

头像被屏蔽
推荐
FAFA 发表于 2025-1-10 03:13
提示: 该帖被管理员或版主屏蔽
头像被屏蔽
推荐
醉卧丿奈何桥 发表于 2026-2-9 11:06
推荐
cn2jp 发表于 2025-1-10 00:01
推荐
submariner 发表于 2025-1-14 11:28
Alekss 发表于 2025-1-14 09:55
索取来直接用不用注册什么的吗

不要注册码怎么区分正版?这个版本还是要注册的,只是注册后没有广告;普通的中文版,无论注册还是不注册,都是有广告弹窗的
4#
Youngsen 发表于 2025-1-9 23:53
感谢分享
5#
ltgb 发表于 2025-1-10 00:06
官方无广告版应该是好事
6#
4vad 发表于 2025-1-10 00:07
牛,这是什么理子?
7#
xiaopaobing 发表于 2025-1-10 00:26
官方无广告是全中文吗,是不是有地方没汉化?
8#
zhouxinyi 发表于 2025-1-10 01:36
只有py脚本?整个exe就方便了
9#
wecanfly9292 发表于 2025-1-10 05:47
太方便了,还能自动下载
10#
jslyg 发表于 2025-1-10 06:33
一直用烈火版本,最进他的网站打不开了。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

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

GMT+8, 2026-5-17 04:01

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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