#! /usr/local/env python
#-*- coding=utf-8 -*-
import os
import stat
fileConfigList = (
r"\PPLive\PPTV\xml\framegallop.xml",
r"\PPLive\PPTV\xml\playctrlgallop.xml",
r"\PPLive\PPTV\cache\pluginad\AdList6.Xml",
r"\PPLive\PPTV\cache\pluginad\AdConfig.ini"
)
for file in fileConfigList:
#所有用户的PROFILE路径
if not os.path.exists(os.getenv('APPDATA') + file):
file = os.getenv('ALLUSERSPROFILE') + "\\Application Data" + file
else:
#当前用户的应用程序路径
file = os.getenv('APPDATA') + file
#修改为可写属性
os.chmod(file, stat.S_IWRITE)
#清空文件
open(file,"w").write("")
#修改为只读属性,pplive将不再能写入广告
os.chmod(file, stat.S_IREAD)
学习python pptv去广告脚本
最新推荐文章于 2021-06-20 15:01:57 发布
本文介绍了一种通过更改特定文件权限的方法来阻止PPLive软件显示广告的技术方案。该方法涉及修改包括framegallop.xml在内的四个配置文件,并将其设置为只读以防止应用程序写入更新。
382

被折叠的 条评论
为什么被折叠?



