ctberthiaume/gdcp

ID parsing issue?

Closed this issue · 2 comments

This works:

gdcp download -i 0B__fjS2wOAmmSGxpMDhMSWtCaFU ./

This does not:

gdcp download -i 'https://drive.google.com/open?id=0B__fjS2wOAmmSGxpMDhMSWtCaFU' ./
Traceback (most recent call last):
  File "/usr/local/bin/gdcp", line 1227, in <module>
    main()
  File "/usr/local/bin/gdcp", line 1224, in main
    cli()
  File "/usr/local/bin/gdcp", line 1168, in cli
    args.func(args)
  File "/usr/local/bin/gdcp", line 1186, in cli_download
    gdcp.download(ids=ids, checksum=not args.no_checksum, root=args.target)
  File "/usr/local/bin/gdcp", line 87, in download
    f.download()
  File "/usr/local/bin/gdcp", line 271, in download
    self._ensure_google_file_metadata()
  File "/usr/local/bin/gdcp", line 517, in _ensure_google_file_metadata
    response = execute_request(request)
  File "/usr/local/lib/python2.7/dist-packages/backoff.py", line 271, in retry
    ret = target(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/backoff.py", line 271, in retry
    ret = target(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/backoff.py", line 271, in retry
    ret = target(*args, **kwargs)
  File "/usr/local/bin/gdcp", line 760, in execute_request
    return request.execute()
  File "/usr/local/lib/python2.7/dist-packages/oauth2client/util.py", line 137, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/googleapiclient/http.py", line 729, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 404 when requesting https://www.googleapis.com/drive/v2/files/open%3Fid%3D0B__fjS2wOAmmSGxpMDhMSWtCaFU?alt=json returned "File not found: open?id=0B__fjS2wOAmmSGxpMDhMSWtCaFU">

Yeah, I saw this the other day. There used to be something like '&authuser=0' at the end of those links. I updated the regexes to parse the ID out of the URL in 634fd82. Pull the latest version and it should work again. Supporting this URL parsing is a nice convenience, but it does create a constant maintenance job since Google makes no guarantees on the format of those URLs.

Thanks, I should have checked for any newer builds.

On Jul 2, 2015, at 5:08 PM, Chris Berthiaume notifications@github.com wrote:

Yeah, I saw this the other day. There used to be something like '&authuser=0' at the end of those links. I updated the regexes to parse the ID out of the URL in 634fd82. Pull the latest version and it should work again. Supporting this URL parsing is a nice convenience, but it does create a constant maintenance job since Google makes no guarantees on the format of those URLs.


Reply to this email directly or view it on GitHub.