今天被同步盘搞得焦头烂额。
辛苦码的代码(除了重要的、备份过的)都被删掉了……
当时我就石化了。。。
随后发现同步盘目录有个delete目录,里面还有manifest.xml,和一堆改了名的文件,
看到manifest.xml的内容时,瞬间觉得有救了,立马开搞python
废话不多说,直接上代码:
#-*- coding:utf-8 -*- from xml.etree import ElementTree import os import sys reload(sys) sys.setdefaultencoding( "utf-8" ) def convertfile(cachePath,orgPath): '''恢复文件''' start=0; while True: index = orgPath.find('\\', start) if index == -1: break start = index + 1 orgDir=orgPath[:start] print 'orgDir:',orgDir if not os.path.exists(orgDir): os.makedirs(orgDir) if not os.path.exists(orgPath) or(os.path.exists(orgPath) and (os.path.getsize(orgPath) != os.path.getsize(cachePath))): file_in=open(cachePath, "rb") file_out=open(orgPath, "wb") file_out.write(file_in.read()) file_in.close() file_out.close() def read_xml(text): '''读xml文件''' root = ElementTree.fromstring(text) lst_node = root.getiterator("record") for node in lst_node: cp=node.attrib['cachePath'] op=node.attrib['orgPath'] cp=cp.replace('~','.') op=op.replace('~','.') print cp+'->'+op convertfile(cp,op) if __name__ == '__main__': '''将本文件放在云同步盘的根目录下, 将mani_file改为需要恢复的manifest文件''' mani_file=".\\.baohe.cache\\.delete\\20140412\\manifest.xml" read_xml(open(mani_file).read())
本文件在Python2.7.6下正常,3.4貌似有问题(汗)
python可以在官网下载:https://www.python.org/downloads/
将本文件(假如叫做huifu.py)放在云同步盘的根目录下,比如云同步盘在“d:\baiduyun\”,那么文件应该在“d:\baiduyun\”下,最终是这样的“d:\baiduyun\huifu.py”
千万不要轻易从百度云上删除已经上传的文件啊!血泪教训。。。
以上这篇恢复百度云盘本地误删的文件脚本(简单方法)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年09月21日
2024年09月21日
- 《演灭Evotinction》正式登陆多平台发售!带你进入科幻潜行新境界
- 命运圣契2024公测最新兑换码大全 命运圣契开服可用兑换码汇总
- 银霞.1979-《回答·兰花草》新加坡限量复黑版[WAV+CUE]
- 王菲.1996-《乐乐精逊SACD日本限量版[WAV+CUE]
- 王菲.1996-《乐乐精逊SACD日本限量版[WAV+CUE]
- 不止黑神话!杭州给原创企业真金白银扶持 打造“杭州游戏”品牌
- 很有多样性:《战锤》首次引入非二元性别角色
- 《少女前线2:追放》项目组将裁员 官方:进一步优化组织结构
- 陈慧琳.2002-闪亮每一天新歌+精选2CD【正东】【WAV+CUE】
- 袁培华.1992-有缘【歌林】【WAV+CUE】
- 王瑞霞.1996-是我太软心【名冠】【WAV+CUE】
- 《谭维维 30首经典流行歌曲精选辑 2CD》[WAV/分轨][1.1GB]
- 《赵传 出道三十年全新大碟 你过得还好吗》[WAV/分轨][460MB]
- 《发烧四大天王 磁性男声HiFi发烧碟 2CD》[WAV/分轨][1GB]
- 黑神话悟空上品鼠司空精魄获取方法一览|上品鼠司空精魄收集攻略