subhra74 / xdm

Powerfull download accelerator and video downloader
https://xtremedownloadmanager.com/
GNU General Public License v2.0
6.75k stars 1.1k forks source link

When dowloading a .htm file, quitely renames it .html #97

Open ghost opened 4 years ago

ghost commented 4 years ago

The link I'm downloading is https://ssccust1.spreadsheethosting.com/1/56/a9d6cf28f0f154/excelwraps-contact-form/excelwraps-contact-form.htm The file is permanent so you should be able to recreate using the same file.

With this link in my clipboard, I open XDM and press the plus button. It detects the URL, creates a New download, with the correct filetype .htm.

xdm-new-download

When I click Download now, it downloads the file, then presents the Download complete window. The file type has now been changed to .html which isn't the same file. To use the file, I must always rename it.

xdm-download complete

I would like the code to be changed so that .htm files are downloaded with an .htm extension.

This is XDM 7.2.10 with runtime 11.0.6 on Windows 10.1903.

I pasted the contents of the command line window below.

Many thanks for a great downloader!

Cheers, Magnus

Microsoft Windows [Version 10.0.18362.720] (c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\magnu>cd "C:\Program Files (x86)\XDM"

C:\Program Files (x86)\XDM>"java-runtime\bin\java" -jar xdman.jar [ main ] loading... [ main ] 11.0.6 10.0 [ main ] starting monitoring... [ Thread-0 ] instance starting... [ Thread-0 ] Init app [ Thread-0 ] Loading fonts [ Thread-0 ] Loading config... en [ Thread-0 ] Loading language en [ Thread-0 ] Context initialized [ Thread-0 ] instance started. [ AWT-EventQueue-0 ] showing main window. New session New session [ AWT-EventQueue-0 ] Dpi scale init: 2.25 icon type:xxhdpi checking for app update icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi New session icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi icon type:xxhdpi [ AWT-EventQueue-0 ] List changed [ Thread-1 ] manifest download response: 200 7.2.10 7.2.10 [ Thread-3 ] java.io.IOException: Unexpected EOF while reading header line at xdman.util.NetUtils.readLine(NetUtils.java:18) at xdman.monitoring.Request.read(Request.java:16) at xdman.monitoring.MonitoringSession.serviceRequest(MonitoringSession.java:498) at xdman.monitoring.MonitoringSession.run(MonitoringSession.java:527) at java.base/java.lang.Thread.run(Unknown Source) [ Thread-4 ] java.io.IOException: Unexpected EOF while reading header line at xdman.util.NetUtils.readLine(NetUtils.java:18) at xdman.monitoring.Request.read(Request.java:16) at xdman.monitoring.MonitoringSession.serviceRequest(MonitoringSession.java:498) at xdman.monitoring.MonitoringSession.run(MonitoringSession.java:527) at java.base/java.lang.Thread.run(Unknown Source) New session [ Thread-5 ] java.io.IOException: Unexpected EOF while reading header line at xdman.util.NetUtils.readLine(NetUtils.java:18) at xdman.monitoring.Request.read(Request.java:16) at xdman.monitoring.MonitoringSession.serviceRequest(MonitoringSession.java:498) at xdman.monitoring.MonitoringSession.run(MonitoringSession.java:527) at java.base/java.lang.Thread.run(Unknown Source) New session [ Thread-6 ] java.io.IOException: Unexpected EOF while reading header line at xdman.util.NetUtils.readLine(NetUtils.java:18) at xdman.monitoring.Request.read(Request.java:16) at xdman.monitoring.MonitoringSession.serviceRequest(MonitoringSession.java:498) at xdman.monitoring.MonitoringSession.run(MonitoringSession.java:527) at java.base/java.lang.Thread.run(Unknown Source) New session [ Thread-7 ] java.io.IOException: Unexpected EOF while reading header line at xdman.util.NetUtils.readLine(NetUtils.java:18) at xdman.monitoring.Request.read(Request.java:16) at xdman.monitoring.MonitoringSession.serviceRequest(MonitoringSession.java:498) at xdman.monitoring.MonitoringSession.run(MonitoringSession.java:527) at java.base/java.lang.Thread.run(Unknown Source) New session icon type:xxhdpi icon type:xxhdpi Last focus owner: javax.swing.JRootPane[,0,0,1687x1012,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=] [ AWT-EventQueue-0 ] Deleting metadata for e78a0dce-a50a-462e-baf8-38ce30b4274a [ AWT-EventQueue-0 ] Deleted manifest e78a0dce-a50a-462e-baf8-38ce30b4274a true [ AWT-EventQueue-0 ] Deleted tmp folder e78a0dce-a50a-462e-baf8-38ce30b4274a false [ AWT-EventQueue-0 ] List changed [ Thread-8 ] java.io.IOException: Unexpected EOF while reading header line at xdman.util.NetUtils.readLine(NetUtils.java:18) at xdman.monitoring.Request.read(Request.java:16) at xdman.monitoring.MonitoringSession.serviceRequest(MonitoringSession.java:498) at xdman.monitoring.MonitoringSession.run(MonitoringSession.java:527) at java.base/java.lang.Thread.run(Unknown Source) New session icon type:xxhdpi icon type:xxhdpi [ AWT-EventQueue-0 ] file: excelwraps-contact-form.htm [ AWT-EventQueue-0 ] Adding to: '' [ AWT-EventQueue-0 ] 12e62796-821b-4717-acea-1725ccec7fa0 added to [ AWT-EventQueue-0 ] starting 12e62796-821b-4717-acea-1725ccec7fa0 with: xdman.downloaders.metadata.HttpMetadata@1621321 is dash: false [ AWT-EventQueue-0 ] creating folder C:\Users\magnu.xdman\temp\12e62796-821b-4717-acea-1725ccec7fa0 [ AWT-EventQueue-0 ] File opened d7de9622-986e-4c29-9c11-9498fdbbec28 Headers all: [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Connecting to: https://ssccust1.spreadsheethosting.com/1/56/a9d6cf28f0f154/excelwraps-contact-form/excelwraps-contact-form.htm null [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Initating connection [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Creating new socket [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Tcp RWin: 65536 [ AWT-EventQueue-0 ] List changed [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Sending request: GET /1/56/a9d6cf28f0f154/excelwraps-contact-form/excelwraps-contact-form.htm HTTP/1.1 Range: bytes=0- host: ssccust1.spreadsheethosting.com

[ d7de9622-986e-4c29-9c11-9498fdbbec28 ] HTTP/1.1 206 Partial Content [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Date: Sat, 04 Apr 2020 08:24:48 GMT Content-Type: text/html Content-Length: 10530 Connection: keep-alive x-amz-id-2: pUcHbZaKSO2tpMXtvuAtZ7Je6X/sv/agmF9CADs/IhmeWgr5TpkOSNumqCZy8uCJp0Yb0c6KosE= x-amz-request-id: FEA490B98A70F47F Last-Modified: Tue, 28 Jan 2020 08:51:19 GMT ETag: "d085e839b6a9c9db642d978e113acd0e" Server: CDN77-Turbo X-Edge-IP: 195.181.175.50 X-Edge-Location: frankfurtDE X-Cache: REVALIDATED X-Age: 236163 Content-Range: bytes 0-10529/10530

[ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Content-Encoding: null [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] d7de9622-986e-4c29-9c11-9498fdbbec28: 206 [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Connection success [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Setting length of d7de9622-986e-4c29-9c11-9498fdbbec28 to: 10530 [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] size: 10530 [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] new filename: excelwraps-contact-form.html [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] confirmed 12e62796-821b-4717-acea-1725ccec7fa0 [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Checking for filename change true [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] checking for same named file on disk... [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Updating file name- old: excelwraps-contact-form.html new: excelwraps-contact-form.html [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] List updated [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] active count:1 [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Total inactive chunks: 0 [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Receiving by copyStream1 [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] List updated [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Total inactive chunks: 0 [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Releasing socket for reuse [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] List updated [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] checking for same named file on disk... [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Updating file name- old: excelwraps-contact-form.html new: excelwraps-contact-form.html [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] assembling... [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] chunk 0 false [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] List updated [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] checking for same named file on disk... [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Updating file name- old: excelwraps-contact-form.html new: excelwraps-contact-form.html [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] ****Download finished***** [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] List updated [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] List changed [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Delete: C:\Users\magnu.xdman\temp\12e62796-821b-4717-acea-1725ccec7fa0\d7de9622-986e-4c29-9c11-9498fdbbec28 [10530] true [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Delete: C:\Users\magnu.xdman\temp\12e62796-821b-4717-acea-1725ccec7fa0\state.txt [95] true [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] d7de9622-986e-4c29-9c11-9498fdbbec28 complete and closing 10530 10530 [ d7de9622-986e-4c29-9c11-9498fdbbec28 ] Copy Stream finished [ Thread-9 ] java.io.IOException: Unexpected EOF while reading header line at xdman.util.NetUtils.readLine(NetUtils.java:18) at xdman.monitoring.Request.read(Request.java:16) at xdman.monitoring.MonitoringSession.serviceRequest(MonitoringSession.java:498) at xdman.monitoring.MonitoringSession.run(MonitoringSession.java:527) at java.base/java.lang.Thread.run(Unknown Source) New session

C:\Program Files (x86)\XDM>

subhra74 commented 4 years ago

what happens if you copy the link and download in browser? If could be possible that the server depends on cookies, and since the url is being pasted from clipboard any session data/cookies might not be present, which can cause html file

ghost commented 4 years ago

Your "New download" window displays the initial filename that you have determined with the help of the server . All I'm asking is that you also save the file using the name that I specify (or just approve) in that text box, without asking the server again and without using a different filename than the one that I have approved. If you really, really must rename it to .html then this must be visible already in this text box, you can't just suddenly change the extension in hindsight.

subhra74 commented 4 years ago

This is a bug, htm should not be renamed to html, it should stay htm. Just curious: what difference does it make if its html.

ghost commented 4 years ago

If I download a file and then upload it on a different server, I expect to update the domain part of the link, but not the filename part. filename.htm and filename.html are simply not the same file. Thanks for identifying this as a bug. It does not deserve an urgent fix, I just wanted to report it.

ogrammer commented 3 years ago

You can read the comments about this here: https://github.com/subhra74/xdm/blob/bca24224700723f40edd52099ea9e55892787077/app/src/main/java/xdman/downloaders/http/HttpDownloader.java#L53-L54