Skip to content

Commit

Permalink
Small fix for links directly to images.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreitbart committed Mar 31, 2016
1 parent dda75ae commit b811d7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fromURL.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (client *Client) GetInfoFromURL(url string) (*GenericInfo, int, error) {
// https://i.imgur.com/<id>.jpg -> image
if strings.Contains(url, "://i.imgur.com/") {
start := strings.LastIndex(url, "/") + 1
end := strings.LastIndex(url, ".") - 1
end := strings.LastIndex(url, ".")
if start == -1 || end == -1 || start == end {
return nil, -1, errors.New("Could not find ID in URL " + url + ". I was going down i.imgur.com path.")
}
Expand Down

0 comments on commit b811d7e

Please # to comment.