Skip to content

Commit

Permalink
Redirect to IG if failed to scrape
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikidepia committed Aug 28, 2024
1 parent 5c22935 commit 21cd0c0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions handlers/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ func Embed(w http.ResponseWriter, r *http.Request) {

item, err := scraper.GetData(postID)
if err != nil || len(item.Medias) == 0 {
viewsData.Description = "Post might not be available"
views.Embed(viewsData, w)
http.Redirect(w, r, viewsData.URL, http.StatusFound)
return
}

Expand Down

0 comments on commit 21cd0c0

Please sign in to comment.