Repositories (1)
tumblr-downloader
4 snippets stored for this repo
var (
inlineSearch = regexp.MustCompile(`(http:\/\/\d{2}\.media\.tumblr\.com\/\w{32}\/tumblr_inline_\w+\.\w+)`) // FIXME: Possibly buggy/unoptimized.
videoSearch = regexp.MustCompile(`"hdUrl":".*(tumblr_\w+)"`) // fuck it
altVideoSearch = regexp.MustCompile(`source src=".*(tumblr_\w+)(?:\/\d+)?" type`)
gfycatSearch = regexp.MustCompile(`href="https?:\/\/(?:www\.)?gfycat\.com\/(\w+)`)
)
err = json.Unmarshal(contents, &blog)
if err != nil {
// Goddamnit tumblr, make a consistent API that doesn't
// fucking return strings AND booleans in the same field
ioutil.WriteFile("json_error.txt", contents, 0644)
log.Println("Unmarshal:", err)
inlineSearch = regexp.MustCompile(`(http:\/\/\d{2}\.media\.tumblr\.com\/\w{32}\/tumblr_inline_\w+\.\w+)`) // FIXME: Possibly buggy/unoptimized.
videoSearch = regexp.MustCompile(`"hdUrl":".*(tumblr_\w+)"`) // fuck it
altVideoSearch = regexp.MustCompile(`source src=".*(tumblr_\w+)(?:\/\d+)?" type`)
// Goddamnit tumblr, make a consistent API that doesn't
// fucking return strings AND booleans in the same field