[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[技术讨论] HTA版网易图片自由下载工具

程序说明:网易图片不能直接用右键下载。本工具可以自由查询、预览、下载网易图片(gif、jpg)
使用说明:将以下代码保存为[filename].hta即可

最后附上附件
  1. <TITLE>网易文件摄取</TITLE>
  2. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  3. <HTA:APPLICATION
  4. ID="MyhyliApp"
  5. APPLICATIONNAME="设置程序"
  6. VERSION="1.0"
  7. SCROLL="no"
  8. INNERBORDER="no"
  9. CONTEXTMENU="no"
  10. CAPTION="yes"
  11. SHOWINTASKBAR="yes"
  12. SINGLEINSTANCE="yes"
  13. SYSMENU="yes"
  14. WINDOWSTATE="normal"
  15. NAVIGABLE="yes"
  16. />
  17. <script language="vbscript">
  18. Sub Window_onLoad
  19.      window.resizeTo 750,515
  20.   ileft=(window.screen.width-750)/2
  21.   itop=(window.screen.height-515)/2      
  22.   window.moveTo ileft,itop                     
  23. end sub
  24. function connect(num)
  25. dim imageinfo,length
  26. fileext=Atype.options(Atype.selectedindex).value
  27. imgtype=imagetype.options(imagetype.selectedindex).value
  28. imgtypenum=Atype.selectedindex
  29. url="http://mms.163.com/new_web/cm_lv2_pic.jsp?catID="&imgtype&"&ord=dDate&page="&num&"&type="&imgtypenum&"&key="
  30. imageurl="http://mmsimg.163.com/new_web/loaditem.jsp/type="&imgtypenum&"/path="
  31. set http=createobject("Microsoft.XMLHTTP")
  32. http.open "GET",url,False
  33. http.send
  34. vIn=http.ResponseBody
  35. strReturn = ""
  36. For i = 1 To LenB(vIn)
  37. ThisCharCode = AscB(MidB(vIn,i,1))
  38. If ThisCharCode < &H80 Then
  39. strReturn = strReturn & Chr(ThisCharCode)
  40. Else
  41. NextCharCode = AscB(MidB(vIn,i+1,1))
  42. strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt (NextCharCode))
  43. i = i + 1
  44. End If
  45. Next
  46. '------获取文件的地址------------'
  47. do
  48. pos=instr(strReturn,"showPic")
  49. pos1=instr(strReturn,"128x128")
  50. if pos>0 then
  51. length=pos1-pos
  52. imageinfo=mid(strReturn,pos,length)
  53. images=split(imageinfo,",")
  54. imagepath=mid(images(2),2,len(images(2))-1)&"128x128."& fileext
  55. '----------获取文件的名字------------'  
  56. namepos=instr(strReturn,"\n名字:")
  57. namepos1=instr(strReturn,"\n人气")
  58. namelength=namepos1-namepos
  59. imagename=mid(mid(strReturn,namepos,namelength),6)
  60.     strHTML=strHTML & "<tr><td><span class='grid2'><input id=addme type=checkbox>选定</span></td>"
  61.     strHTML=strHTML &"<td><span class='grid3'><a onMousemove='view()' onmouseout='hideview()' href=#><img onClick='addpro()' src='"&imageurl&imagepath&"' width=30 height=20></a></span></td>"
  62. strHTML=strHTML & "<td><span class='grid2'>" & imagepath & "</span></td>"
  63. strHTML=strHTML & "<td><span class='grid2'>" & imagename & "</span></td></tr>"
  64. strReturn=mid(strReturn,namepos1+20)
  65. else
  66. exit do
  67. end if
  68. loop
  69. connect=strHTML
  70. end function
  71. function writeinner()
  72. for i=start1.value to start2.value
  73. strHTML=strHTML & connect(i)
  74. next
  75. strHTML="<table id='mytable' width=100% border=1 bordercolor=green>" &str1&strHTML& "</table>"
  76. list.innerHTML=strHTML
  77. infotext.innertext=infotext.innertext & "连接成功。"
  78. infotext.innertext=infotext.innertext & vbcrlf &vbcrlf & "从第" & start1.value & "页到第" & start2.value & "页的gif图片文件信息!"
  79. end function
  80. function show()
  81. if not (isnumeric(start2.value)) or not (isnumeric(start2.value)) then
  82. infotext.innertext=infotext.innertext & vbcrlf & "配置错误..."
  83. else
  84. infotext.innertext="正在连接..."
  85. window.settimeout "writeinner()",200
  86. end if
  87. end function
  88. sub view()
  89. strHTML1="<img src='" &window.event.srcElement.src &"' width='140' height='140'>"
  90. preview.runtimeStyle.pixelLeft=window.event.x+5
  91. preview.runtimeStyle.pixelTop=window.event.y+5
  92. preview.style.visibility="visible"
  93. preview.innerHTML=strHTML1
  94. end sub
  95. sub hideview()
  96. preview.style.visibility="hidden"
  97. end sub
  98. sub addpro()
  99. set obj=window.event.srcElement.parentelement.parentelement.parentelement.parentelement
  100. if obj.cells(0).children(0).children(0).checked=false then
  101. obj.cells(0).children(0).children(0).checked=true
  102. else
  103. obj.cells(0).children(0).children(0).checked=false
  104. end if
  105. end sub
  106. sub tb_del()
  107. set obj=document.all.namedItem("mytable")
  108. if obj.rows.length>2 then
  109. Set tagID = document.all.namedItem("addme")   '获取对象ID:delcheck'
  110. for each otag in tagID
  111. if otag.checked then
  112. objrow=otag.parentelement.parentelement.parentelement.rowindex       '获取对象的行序数;'
  113. obj.deleteRow(objrow)  '删除该项;'
  114. end if
  115. next
  116. else
  117. msgbox "才一项你都删,哪有这样的?!",0,"删除提醒"
  118. exit sub
  119. end if
  120. end sub
  121. sub selectall()
  122. set obj=document.all.namedItem("mytable")
  123. set objcheck=document.all.namedItem("sall")
  124. Set tagID = document.all.namedItem("addme")   '获取对象ID:addme'
  125. for each otag in tagID
  126. otag.checked=objcheck.checked
  127. next
  128. end sub
  129. sub download()
  130. Set fso = CreateObject("Scripting.FileSystemObject")
  131. If not (fso.FolderExists("★网易下载图片★")) Then
  132. fso.createfolder("★网易下载图片★")
  133. end if
  134. set http=createobject("Microsoft.XMLHTTP")
  135. set obj=document.all.namedItem("mytable")
  136. Set tagID = document.all.namedItem("addme")   '获取对象ID:delcheck'
  137. for each otag in tagID
  138. if otag.checked then
  139. set objrow=otag.parentelement.parentelement.parentelement      '获取对象的行;'
  140. downurl=objrow.cells(1).children(0).children(0).children(0).src
  141. filename=objrow.cells(3).children(0).innertext
  142. http.open "GET",downurl,False
  143. http.send
  144. set aso=createobject("ADODB.Stream")
  145. aso.type=1
  146. aso.open               
  147. aso.write http.ResponseBody
  148. aso.savetofile "★网易下载图片★\" & filename & "."&fileext,2
  149. aso.close
  150. end if
  151. next
  152. infotext.innertext=infotext.innertext & vbcrlf & "文件下载成功。"
  153. infotext.innertext=infotext.innertext & vbcrlf & "文件保存在:" & vbcrlf &"“★网易下载图片★”下"
  154. end sub
  155. sub downloadfile()
  156. infotext.innertext= "正在下载文件...."  '"
  157. window.settimeout "download()",200
  158. end sub
  159. sub changevalue()
  160. AID=array("130","112","67","14","122","158")
  161. PID=array("90","91","89","34","198","200")
  162. if Atype.selectedindex=0 then
  163. for i=0 to 5
  164. imagetype.options(i+2).value=PID(i)
  165. next
  166. else
  167. for i=0 to 5
  168. imagetype.options(i+2).value=AID(i)
  169. next
  170. end if
  171. end sub
  172. </script>
  173. <style type="text/css">
  174. <!--
  175. .TT1 { font-family: "隶书";
  176. font-size: 24px;
  177. font-weight: bold;
  178. }
  179. .title {
  180. }
  181. .info {
  182. font-family: "隶书";
  183. font-size: 16px;
  184. color: #FF0000;
  185. font-weight: bold;
  186. }
  187. .separator { width:100%;
  188. margin:2px;
  189. margin-top:-4px;
  190. height:12px;
  191. overflow:hidden;
  192. }
  193. .list { height: 80px;
  194. width: 100%;
  195. background-color: #E3EFF9;
  196. }
  197. .s_button {
  198. background-color: #FFCC99;
  199. position: static;
  200. text-align: center;
  201. vertical-align: middle;
  202. padding: 1px;
  203. color: #0033CC;
  204. border: 1px solid #996633;
  205. width: 100%;
  206. }
  207. .grid1 {
  208. font-family: "隶书";
  209. font-size: 16px;
  210. background-color: #006699;
  211. background-position: center center;
  212. text-align: center;
  213. vertical-align: middle;
  214. height: 100%;
  215. width: 100%;
  216. color: #00FF99;
  217. }
  218. .grid2 {
  219. font-family: "宋体";
  220. text-align: left;
  221. vertical-align: middle;
  222. height: 100%;
  223. width: 100%;
  224. font-size: 12px;
  225. }
  226. .grid3 {
  227. text-align: center;
  228. vertical-align: middle;
  229. height: 100%;
  230. width: 100%;
  231. }
  232. .preview {
  233. position:absolute;
  234. width:140px;
  235. height:140px;
  236. z-index:1;
  237. left: 301px;
  238. top: 61px;
  239. overflow: visible;
  240. border-top-color: #FF0000;
  241. border-right-color: #FF0000;
  242. border-bottom-color: #FF0000;
  243. border-left-color: #FF0000;
  244. background-color: #FF9966;
  245. margin: 1px;
  246. padding: 1px;
  247. visibility: hidden;
  248. }
  249. .STYLE2 {
  250. color: #00FF00;
  251. font-weight: bold;
  252. font-family: "隶书";
  253. font-size: 14px;
  254. }
  255. -->
  256. </style>
  257.   <div class="separator">
  258.     <hr>
  259.   </div>
  260. <table width="100%" height="4%" border="0" cellspacing="0" cellpadding="0">
  261.   <tr>
  262.     <td colspan="2" align="center" valign="middle" id=menubar onselectstart="return false"><span class="TT1" id="consume">网易图片文件一览表</span> </td>
  263.   </tr>
  264. </table>
  265.   <div class="separator">
  266.     <hr>
  267.   </div>
  268. <table width="100%" height="415" border="1">
  269.   <tr>
  270.     <td width="81%" height="16" rowspan="8" valign="top" bgcolor="#FFFFFF" style="border-style: solid; border-color: #000080"><div class="info" id=list style="width:100%;height:405; overflow-y: auto; border: solid 1 gray;"></div></td>
  271.     <td height="16" colspan="2" align="center" valign="middle" bordercolor="#FF0000" bgcolor="#000080" style="border-style: solid; border-color: #000080"><div class="preview" id="preview">
  272.       <p>&nbsp;</p>
  273.     </div>
  274.       <span class="STYLE2"> 信息公布</span></td>
  275.   </tr>
  276.   <tr>
  277.     <td height="182" colspan="2" align="left" valign="top" bgcolor="#FFFFFF" class="info" style="border-style: solid; border-color: #000080"><div class="info" id="infotext" style="width:100%;height:177; overflow-y: auto">
  278.       <p>本程序可以自由下载网易图片..</p>
  279.       <p>&nbsp;</p>
  280.     </div></td>
  281.   </tr>
  282.    <tr>
  283.     <td height="33" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" class="info" style="border-style: solid; border-color: #000080"><input name="add" type="submit" class="s_button" id="add" onclick="show()" value="取文件信息" /></td>
  284.   </tr>
  285.   
  286.   <tr>
  287.     <td height="33" align="center" valign="middle" bgcolor="#FFFFFF" style="border-style: solid; border-color: #000080"><select name="Atype" id="Atype" onchange="changevalue()">
  288.       <option value="jpg">彩图</option>
  289.       <option value="gif">动画</option>
  290.                         </select></td>
  291.     <td height="33" align="center" valign="middle" bgcolor="#FFFFFF" style="border-style: solid; border-color: #000080"><select name="imagetype" id="imagetype">
  292.       <option selected="selected">图片类型</option>
  293.       <option>全部</option>
  294.       <option value="90">绝色风光</option>
  295.       <option value="91">四季花语 </option>
  296.       <option value="89">海底世界 </option>
  297.       <option value="34">绝色美女 </option>
  298.       <option value="198">都市丽人</option>
  299.       <option value="200">手绘美女</option>
  300.     </select></td>
  301.   </tr>
  302.   <tr>
  303.     <td height="33" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" style="border-style: solid; border-color: #000080"><input name="del2" type="submit" class="s_button" id="del2" onclick="downloadfile()" value="下载选定项" /></td>
  304.   </tr>
  305.   <tr>
  306.     <td height="33" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" style="border-style: solid; border-color: #000080"><input name="del" type="submit" class="s_button" id="del" onclick="tb_del()" value="删除选定项" /></td>
  307.   </tr>
  308.   <tr>
  309.     <td width="5%" height="25" align="center" valign="middle" bgcolor="#000080" class="STYLE2" style="border-style: solid; border-color: #000080">从    </td>
  310.     <td width="14%" bgcolor="#FFFFFF" valign="middle" align="center" style="border-style: solid; border-color: #000080"><a title="在此处输入起始页数"><input name="start1" type="text" id="start1" value="1" size="10" />
  311.     </a></td>
  312.   </tr>
  313.   
  314.   <tr>
  315.     <td height="26" align="center" valign="middle" bgcolor="#000080" class="STYLE2" style="border-style: solid; border-color: #000080">到</td>
  316.     <td height="26" align="center" valign="middle" bgcolor="#FFFFFF" style="border-style: solid; border-color: #000080"><a title="在此处输入结束页数"><input name="start2" type="text" id="start2" size="10" value="1"/>
  317.     </a></td>
  318.   </tr>
  319. </table>
  320. <script language="vbscript">
  321. public fileext
  322. str1="<tr><td><span class='grid1'><input type=checkbox id='sall' onclick='selectall()'>全都选</span></td>"
  323. str1=str1& "<td><span class='grid1'>预览</span></td>"
  324. str1=str1 & "<td><span class='grid1'>文件路径</span></td>"
  325. str1=str1 & "<td><span class='grid1'>文件名称</span></td></tr>"
复制代码
链接: https://pan.baidu.com/s/1mFNe5yXB28ELmyA3oy1nyQ?pwd=k9ke

返回列表