吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 3954|回复: 0
收起左侧

[其他转载] 刮削文件名生成剧集nfo的bat脚本

[复制链接]
爱咪哆 发表于 2017-11-27 08:16
效果:自动生成剧集nfo
缺点:不能自动生成tvshow.nfo
求助:求大牛把当前文件夹名写入tvshow.nfo
[Asm] 纯文本查看 复制代码
@if (@a)==(@b) [url=home.php?mod=space&uid=262062]@End[/url] /*
@echo off &setlocal
for /r %%i in (*.mkv *.avi *.mp4 *.mpg *.m2ts *.m4v *.mov *.rm *.rmvb *.flv *.f4v *.wmv *.webm) do (
  cscript //nologo //e:jscript "%~fs0" "%%~fi"
)
for %%i in (*.mkv *.avi *.mp4 *.mpg *.m2ts *.m4v *.mov *.rm *.rmvb *.flv *.f4v *.wmv *.webm)
for %%i in (*.nfo) 
pause
exit /b
*/
var objXmlDoc = new ActiveXObject('Microsoft.XMLDOM'),
    objXsltDoc = new ActiveXObject('Microsoft.XMLDOM'),
    objShell = new ActiveXObject('Shell.Application'),
    objFSO = new ActiveXObject('Scripting.FileSystemObject'),
    objADOS = new ActiveXObject('ADODB.Stream');
objADOS.Type = 2; // adTypeText
var strFullName = WScript.Arguments(0),
    strPath = objFSO.GetParentFolderName(strFullName),
    strBaseName = objFSO.GetBaseName(strFullName),
    objItem = objShell.Namespace(strPath).ParseName(objFSO.GetFileName(strFullName)),
    strTitle = getProperty(objItem, 'DocTitle'),
    strRuntime = (Math.round(Number(getProperty(objItem, 'Duration')) / 600000000)).toString(),
    strS25 = '                         ',
    objNode;
WScript.StdOut.Write((strBaseName + strS25).substr(0, 25) + '  ' + (strTitle + strS25).substr(0, 25) + '  ' + ('    ' + strRuntime).slice(-4) + ' min.\n');
objXmlDoc.loadXML('<?xml version="1.0" encoding="UTF-16"?><episodedetails><title /><plot /><runtime /></episodedetails>');
objXsltDoc.loadXML(
  '<?xml version="1.0"?>\n' +
  '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n' +
  ' <xsl:output method="xml" version="1.0" encoding="UTF-8" standalone="yes" indent="yes" />\n' +
  ' <xsl:template match="node()|@*">\n' +
  '  <xsl:copy>\n' +
  '   <xsl:apply-templates select="node()|@*" />\n' +
  '  </xsl:copy>\n' +
  ' </xsl:template>\n' +
  '</xsl:stylesheet>');
objXmlDoc.transformNodeToObject(objXsltDoc, objXmlDoc);
objNode = objXmlDoc.documentElement.selectSingleNode('title');
  objNode.text = strBaseName;
objNode = objXmlDoc.documentElement.selectSingleNode('plot');
  objNode.text = strBaseName;
objNode = objXmlDoc.documentElement.selectSingleNode('runtime');
objNode.text = strRuntime;
objXmlDoc.save(objFSO.BuildPath(strPath, strBaseName + '.nfo'));
function getProperty(objShFI, strPropName) {
  objADOS.Open();
  objADOS.WriteText(objShFI.ExtendedProperty(strPropName));
  objADOS.Position = 0;
  var value = objADOS.ReadText();
  objADOS.Close();
  return value;
}

免费评分

参与人数 1吾爱币 +1 热心值 +1 收起 理由
藏喵喵 + 1 + 1 热心回复!

查看全部评分

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

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

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

GMT+8, 2024-11-15 05:37

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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