User avatar
ksharindam
Posts: 164
Joined: Sat Jan 09, 2016 4:16 pm

Is it possible to unset a mime type?

Tue Feb 25, 2020 2:59 pm

When I download something in chromium browser it adds crdownload extension while downloading. So i can not double click a file and open it until the downloading has finished.
So I want to unset that mimetype. So that, the file type will be correctly detected by its magick number, and I will be able to open it in a program.
Is it possible to do that? Or can I disable adding crdownload extension in chromium?

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Is it possible to unset a mime type?

Tue Feb 25, 2020 3:48 pm

I don't have an answer to your question.

But I can suggest that as an alternative you consider downloading the file with a dedicated tool such as wget or curl.

User avatar
ksharindam
Posts: 164
Joined: Sat Jan 09, 2016 4:16 pm

Re: Is it possible to unset a mime type?

Wed Feb 26, 2020 3:27 am

I can not use wget or some other download managers, because some downloads can not be started separately in a download manager. May be the site requires cookies or something else to start download.

User avatar
kerry_s
Posts: 760
Joined: Thu Jan 30, 2020 7:14 pm

Re: Is it possible to unset a mime type?

Wed Feb 26, 2020 5:24 am

it does the crdownload meaning it's still downloading it, you want to open before the download is finished? as in incomplete download, it's not on your computer yet till it's finished.

anyways what you can do is start the download, then cancel it, the link in the show all should be a direct link to what ever your trying to download.
here's my wget script gui, in case you want to try that.

Code: Select all

#!/bin/sh

link=`zenity --entry --title="wget download" --text="file to download" --width=500`
cd ~/Downloads
wget $link 2>&1 | sed -u 's/.* \([0-9]\+%\)\ \+\([0-9.]\+.\) \(.*\)/\1\n# Downloading at \2\/s, ETA \3/' | zenity --progress --title="Downloading" --width=500 --auto-close --auto-kill

zenity=0
while [ $zenity -eq 0 ]
do
if [ -z "$(pidof zenity)" ]
then
  pkill wget
  zenity=1
fi
done

exit 0


User avatar
ksharindam
Posts: 164
Joined: Sat Jan 09, 2016 4:16 pm

Re: Is it possible to unset a mime type?

Wed Feb 26, 2020 2:16 pm

I know how to use wget. But some download requires cookies, so if I copy the link and try to download in wget, the download does not start.
Hence, I must have to download in chromium.

User avatar
rpdom
Posts: 17189
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Is it possible to unset a mime type?

Wed Feb 26, 2020 2:36 pm

wget can use cookies. If you can get at the cookie details from your browser you can save those into a file and tell wget to use them.
Unreadable squiggle

User avatar
DougieLawson
Posts: 39169
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Is it possible to unset a mime type?

Wed Feb 26, 2020 4:00 pm

How about lynx. That's a fully-fledged text browser which sometimes works until the site you're visiting needs javascript to work properly. Lynx has support for cookies and can store them in a cookie jar.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
kerry_s
Posts: 760
Joined: Thu Jan 30, 2020 7:14 pm

Re: Is it possible to unset a mime type?

Wed Feb 26, 2020 5:36 pm

like he said, wget has a lot of settings "wget --help", never the less a .crdownload is an incomplete download.

User avatar
ksharindam
Posts: 164
Joined: Sat Jan 09, 2016 4:16 pm

Re: Is it possible to unset a mime type?

Thu Feb 27, 2020 5:40 pm

I solved the problem by editing the file /usr/share/mime/packages/freedesktop.org.xml . and then deleted the line
<glob pattern="*.crdownload"/>
then ran command

Code: Select all

sudo update-mime-database /usr/share/mime
Now the file type is detected correctly by its magic number in a file manager.

Return to “Raspberry Pi OS”