You are not logged in.

#1 2015-08-17 13:25:20

helix
Member
Registered: 2013-02-17
Posts: 180

[SOLVED] Problem downloading file from Google Drive in PKGBUILD

I searched how to download file libregreek.oxt directly from Google Drive address

https://docs.google.com/file/d/0Bzdfv0j … BhNWc/edit

and I managed to do it with

wget https://docs.google.com/uc?id=0Bzdfv0fijGv6WzeGtDMDE4LVBhNWc&export=download
mv uc\?id\=0Bzdfv0jGv6WzeGtDMDE4LVBhNWc libregreek.oxt

The problem is that my PKGBUILD fails to download it:

# Maintainer: helix <stargr[at]gmail[dot]com>
pkgname=libreoffice-extension-libregreek
pkgver=1.0
pkgrel=4
pkgdesc='An advanced Greek & English dictionary for LibreOffice'
arch=('any')
url='https://github.com/squibbylinux/LibreGreek'
license=('BSD-3')
depends=('libreoffice')
groups=('libreoffice-extensions')
conflicts=('languagetool')
makedepends=('unzip')
source=(libreoffice.oxt::https://docs.google.com/uc?id=0Bzdfv0fijGv6WzeGtDMDE4LVBhNWc&export=download)
sha512sums=('520657aa4fbeda120a63064b1e0b0151d14363c335731952b6f1bb1c994800b815455e77a2ea1a6b3a4e16ab856a542e98d192a6025241c34e1e71bbfa5f141f')

package() {
  install -dm755 $pkgdir/usr/lib/libreoffice/share/extensions
  unzip -q $srcdir/libregreek.oxt -d $pkgdir/usr/lib/libreoffice/share/extensions/libregreek
}

Any suggestions?

Last edited by helix (2015-08-17 22:05:54)

Offline

#2 2015-08-17 13:30:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: [SOLVED] Problem downloading file from Google Drive in PKGBUILD

Two suggestions - see if you can get the upstream source to use something better than dropbox google drive.  If not, you could put the mv command in a prepare function.

edit: sorry, read to quickly, but both google drive and dropbox may be useful for sharing with individuals (debatable really) but neither are any good for broad distribution (edit2: Prograndy's note below about generating a real link may partially remedy this).

Last edited by Trilby (2015-08-17 13:40:04)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2015-08-17 13:36:03

helix
Member
Registered: 2013-02-17
Posts: 180

Re: [SOLVED] Problem downloading file from Google Drive in PKGBUILD

It's Google Drive actually, and it's not my upload, that's why I'm looking on how to get it from there properly. Can PKGBUILD use wget (I assume that by default it uses curl for downloadings)?

Last edited by helix (2015-08-17 13:36:48)

Offline

#4 2015-08-17 13:41:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: [SOLVED] Problem downloading file from Google Drive in PKGBUILD

A PKGBUILD cannot set the dlagent*.  Users can set it for themselves in makepkg.conf.  But does curl fail to get this at all, or is it simply that (either curl or wget) need to have the file renamed after download?

*but you could do all the downloading in the prepare function like people used to do for git sources.  I don't think this is a good idea though.

EDIT: I'd try out some testing here, but it seems even the urls you posted in your first post are only giving a 404 with curl or wget for me.

Last edited by Trilby (2015-08-17 13:45:18)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2015-08-17 13:49:14

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: [SOLVED] Problem downloading file from Google Drive in PKGBUILD

You use the wrong URL, the one you give use results in a 404. Maybe try this service to get the direct download link.
https://sites.google.com/site/gdocs2direct/

Edit: By the way, why are you using unzip? I think makepkg will do that for you. If you don't like that, add a noextract entry.

Last edited by progandy (2015-08-17 13:52:37)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2015-08-17 13:58:15

helix
Member
Registered: 2013-02-17
Posts: 180

Re: [SOLVED] Problem downloading file from Google Drive in PKGBUILD

You are right Trilby, now both don't work

curl -C - -f https://docs.google.com/uc?id=0Bzdfv0fijGv6WzeGtDMDE4LVBhNWc&export=download
[1] 1586
curl: (22) The requested URL returned error: 404 Not Found

wget [url]https://docs.google.com/uc?id=0Bzdfv0fijGv6WzeGtDMDE4LVBhNWc&export=download[/url]
wget https://docs.google.com/uc?id=0Bzdfv0fijGv6WzeGtDMDE4LVBhNWc&export=download
[1] 1708
--2015-08-17 16:50:46--  [url]https://docs.google.com/uc?id=0Bzdfv0fijGv6WzeGtDMDE4LVBhNWc[/url]
Resolving docs.google.com (docs.google.com)... 2a00:1450:4009:80a::200e, 62.75.23.237, 62.75.23.211, ...
Connecting to docs.google.com (docs.google.com)|2a00:1450:4009:80a::200e|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2015-08-17 16:50:46 ERROR 404: Not Found.

I found the instructions on how to convert the Google Drive link into a downloadble link here

http://techathlon.com/download-shared-f … ogle-drive

but now it seems it doesn't work anymore hmm

progandy wrote:

You use the wrong URL, the one you give use results in a 404. Maybe try this service to get the direct download link.
https://sites.google.com/site/gdocs2direct/

Edit: By the way, why are you using unzip? I think makepkg will do that for you. If you don't like that, add a noextract entry.

I got this url from there

https://drive.google.com/uc?export=down … DE4LVBhNWc

and now gives 400 error with both curl and wget. About unzip: I don't know, this was used in a PKGBUILD I hacked to create mine for the first time 2 years ago.

Last edited by helix (2015-08-17 14:08:35)

Offline

#7 2015-08-17 22:04:52

helix
Member
Registered: 2013-02-17
Posts: 180

Re: [SOLVED] Problem downloading file from Google Drive in PKGBUILD

Finally uploaded the new PKGBUILD which downloads the necessary files directly from the project github page. Marking this as solved.

Offline

Board footer

Powered by FluxBB