UpdateURL updates the URL of a paused or errored download via the remote API.
(id string, newURL string)
| 215 | |
| 216 | // UpdateURL updates the URL of a paused or errored download via the remote API. |
| 217 | func (s *RemoteDownloadService) UpdateURL(id string, newURL string) error { |
| 218 | req := map[string]string{ |
| 219 | "url": newURL, |
| 220 | } |
| 221 | resp, err := s.doRequest("PUT", "/update-url?id="+url.QueryEscape(id), req) |
| 222 | if err != nil { |
| 223 | return err |
| 224 | } |
| 225 | defer func() { _, _ = io.Copy(io.Discard, resp.Body); _ = resp.Body.Close() }() |
| 226 | return nil |
| 227 | } |
| 228 | |
| 229 | // Delete cancels and removes a download. |
| 230 | func (s *RemoteDownloadService) Delete(id string) error { |