added error log

This commit is contained in:
rayaman 2025-06-26 11:52:12 -04:00
parent 66761124cc
commit 1cf79d70ed
3 changed files with 16 additions and 5 deletions

3
.gitignore vendored
View File

@ -31,6 +31,5 @@ go.work.sum
# Editor/IDE # Editor/IDE
# .idea/ # .idea/
.vscode/ .vscode/
.goinsta **.json
creds.json
**.log **.log

1
.goinsta Normal file
View File

@ -0,0 +1 @@
{"id":3455317802,"username":"hellarushed","device_id":"android-869fe89913486e1a","family_id":"c5edbf14-3302-41fe-8372-42b23cb4f448","uuid":"5c9b1ddd-0706-4c72-b93e-b23fd548ad75","rank_token":"3455317802_5c9b1ddd-0706-4c72-b93e-b23fd548ad75","token":"","phone_id":"3c33d53f-5cf5-4eaa-91bf-afe6e68786de","xmid_expiry":1750982504,"header_options":{"Authorization":"Bearer IGT:2:eyJkc191c2VyX2lkIjoiMzQ1NTMxNzgwMiIsInNlc3Npb25pZCI6IjM0NTUzMTc4MDIlM0FDbFBXc1RZQlJrQzlkVCUzQTE0JTNBQVlmTUhqOUVJemhnUE5EOHF2VWh0WHoxWUNKOU9nUVRJZDN6YWtHUFl3In0=","Ig-U-Ds-User-Id":"3455317802","Ig-U-Rur":"RVA,3455317802,1782446806:01fe6edcbd433b7ccf461d70ce918eae8544cefa4533bc4b1d691efebe2e8605ce2f4be4","X-Ig-Www-Claim":"hmac.AR1ffqfxjDK85kX8FM3siNHuh4NW6wQajU7_dVRgDFt1oj6W","X-Mid":"aFzGJQABAAGxN_10WLAcwNBhq36g"},"account":{"pk":3455317802,"username":"hellarushed","full_name":"vintin","biography":"","profile_pic_url":"https://scontent-lga3-2.cdninstagram.com/v/t51.2885-19/32632716_210558476405397_7065467204761812992_n.jpg?stp=dst-jpg_e0_s150x150_tt6\u0026_nc_ht=scontent-lga3-2.cdninstagram.com\u0026_nc_cat=109\u0026_nc_oc=Q6cZ2QEaWUHYov0sygNj3GgcTSdLNTYkL6nIfBAyAqZCxgU1vlSRuPx3SUmPiODr6wixeYKM9SweAuVP2mL20ULjNUPD\u0026_nc_ohc=yprXfQ2oXVUQ7kNvwGc5Kun\u0026_nc_gid=znth7VMy7xrJXsGBQOZbIg\u0026edm=AJlpnE4BAAAA\u0026ccb=7-5\u0026ig_cache_key=GIzv8QGVyjB3gL8AAAAAAAD9lA1ibkULAAAB-ccb7-5\u0026oh=00_AfMBA0CDUAK5Kgne7UjJb7RYfWhGeLRO40HSmT0Xdzk24A\u0026oe=68629024\u0026_nc_sid=125e1d","email":"hellarushed@gmail.com","phone_number":"+15162622814","is_business":false,"gender":3,"profile_pic_id":"1398346591831774998_3455317802","can_see_organic_insights":false,"show_insights_terms":false,"nametag":{"mode":0,"gradient":0,"emoji":"","selfie_sticker":0},"has_anonymous_profile_picture":false,"is_private":true,"is_unpublished":false,"allowed_commenter_type":"any","is_verified":false,"media_count":0,"follower_count":0,"following_count":0,"geo_media_count":0,"external_url":"","has_biography_translation":false,"external_lynx_url":"","hd_profile_pic_url_info":{"height":720,"url":"https://scontent-lga3-2.cdninstagram.com/v/t51.2885-19/32632716_210558476405397_7065467204761812992_n.jpg?_nc_ht=scontent-lga3-2.cdninstagram.com\u0026_nc_cat=109\u0026_nc_oc=Q6cZ2QEaWUHYov0sygNj3GgcTSdLNTYkL6nIfBAyAqZCxgU1vlSRuPx3SUmPiODr6wixeYKM9SweAuVP2mL20ULjNUPD\u0026_nc_ohc=yprXfQ2oXVUQ7kNvwGc5Kun\u0026_nc_gid=znth7VMy7xrJXsGBQOZbIg\u0026edm=AJlpnE4BAAAA\u0026ccb=7-5\u0026ig_cache_key=GIzv8QGVyjB3gL8AAAAAAAD9lA1ibkULAAAB99-ccb7-5\u0026oh=00_AfMAtUjLHtScQCGfZI0eiqlM4i2m-f1S33BN9LsMgFVc9A\u0026oe=68629024\u0026_nc_sid=125e1d","width":720},"hd_profile_pic_versions":[{"height":320,"url":"https://scontent-lga3-2.cdninstagram.com/v/t51.2885-19/32632716_210558476405397_7065467204761812992_n.jpg?stp=dst-jpg_s320x320_tt6\u0026_nc_ht=scontent-lga3-2.cdninstagram.com\u0026_nc_cat=109\u0026_nc_oc=Q6cZ2QEaWUHYov0sygNj3GgcTSdLNTYkL6nIfBAyAqZCxgU1vlSRuPx3SUmPiODr6wixeYKM9SweAuVP2mL20ULjNUPD\u0026_nc_ohc=yprXfQ2oXVUQ7kNvwGc5Kun\u0026_nc_gid=znth7VMy7xrJXsGBQOZbIg\u0026edm=AJlpnE4BAAAA\u0026ccb=7-5\u0026ig_cache_key=GIzv8QGVyjB3gL8AAAAAAAD9lA1ibkULAAAB13-ccb7-5\u0026oh=00_AfMKcrQIQwUCnoGlCsacCqNBQvmvwLTrV-BfKDEvpL_PcA\u0026oe=68629024\u0026_nc_sid=125e1d","width":320},{"height":640,"url":"https://scontent-lga3-2.cdninstagram.com/v/t51.2885-19/32632716_210558476405397_7065467204761812992_n.jpg?stp=dst-jpg_s640x640_tt6\u0026_nc_ht=scontent-lga3-2.cdninstagram.com\u0026_nc_cat=109\u0026_nc_oc=Q6cZ2QEaWUHYov0sygNj3GgcTSdLNTYkL6nIfBAyAqZCxgU1vlSRuPx3SUmPiODr6wixeYKM9SweAuVP2mL20ULjNUPD\u0026_nc_ohc=yprXfQ2oXVUQ7kNvwGc5Kun\u0026_nc_gid=znth7VMy7xrJXsGBQOZbIg\u0026edm=AJlpnE4BAAAA\u0026ccb=7-5\u0026ig_cache_key=GIzv8QGVyjB3gL8AAAAAAAD9lA1ibkULAAAB8-ccb7-5\u0026oh=00_AfOi2Gi3ldH8bSpL8nzEgXEhEOU7nZlmTouSPKj7rFRYzg\u0026oe=68629024\u0026_nc_sid=125e1d","width":640}],"usertags_count":0,"has_chaining":false,"reel_auto_archive":"unset","public_email":"","public_phone_number":"","public_phone_country_code":"","contact_phone_number":"","byline":"","mutual_followers_count":0,"city_id":0,"city_name":"","address_street":"","direct_messaging":"","latitude":0,"longitude":0,"category":"","business_contact_method":"","is_call_to_action_enabled":false,"fb_page_call_to_action_id":"","zip":"","allow_contacts_sync":false,"can_boost_post":false},"device":{"manufacturer":"samsung","model":"SM-G975F","code_name":"beyond2","android_version":30,"android_release":11,"screen_dpi":"560dpi","screen_resolution":"1440x2898","chipset":"exynos9820"},"totp":null}

View File

@ -12,6 +12,7 @@ import (
) )
func asciiToBinary(text string) string { func asciiToBinary(text string) string {
utils.Logger.Infof("Converting %v to binary", text)
var result []string var result []string
for _, char := range text { for _, char := range text {
binary := fmt.Sprintf("%08b", char) // 8-bit binary format binary := fmt.Sprintf("%08b", char) // 8-bit binary format
@ -21,6 +22,7 @@ func asciiToBinary(text string) string {
} }
func binaryToASCII(binary string) (string, error) { func binaryToASCII(binary string) (string, error) {
utils.Logger.Infof("Converting %v to ASCII", binary)
// Ensure the length of the binary string is a multiple of 8 // Ensure the length of the binary string is a multiple of 8
if len(binary)%8 != 0 { if len(binary)%8 != 0 {
return "", fmt.Errorf("binary string length must be a multiple of 8") return "", fmt.Errorf("binary string length must be a multiple of 8")
@ -39,38 +41,47 @@ func binaryToASCII(binary string) (string, error) {
} }
func instagramHandleExists(username string, bypass ...bool) string { func instagramHandleExists(username string, bypass ...bool) string {
utils.Logger.Infof("Checking Insta account: %v", username)
records, _ := db.GetRecords(db.QueryOptions{Where: fmt.Sprintf(`handle='%v'`, username)}) records, _ := db.GetRecords(db.QueryOptions{Where: fmt.Sprintf(`handle='%v'`, username)})
if len(records) > 0 && len(bypass) == 0 { if len(records) > 0 && len(bypass) == 0 {
utils.Logger.Infof("Using stored value")
return records[0].URL return records[0].URL
} }
url := fmt.Sprintf("https://www.instagram.com/%s/", username) url := fmt.Sprintf("https://www.instagram.com/%s/", username)
insta, err := goinsta.Import("./.goinsta") utils.Logger.Infof("Attempting to import goinsta.json file")
insta, err := goinsta.Import("goinsta.json")
if err != nil { if err != nil {
utils.Logger.Errorf("Could not log in: %v", err)
user, pass, err := utils.GetCreds() user, pass, err := utils.GetCreds()
if err != nil { if err != nil {
panic(err) utils.Logger.Fatalf("Something went wrong: %v", err)
} }
insta = goinsta.New(user, pass) insta = goinsta.New(user, pass)
if err := insta.Login(); err != nil { if err := insta.Login(); err != nil {
utils.Logger.Errorf("Could not login: %v", err)
return "" return ""
} }
} }
defer insta.Export("./.goinsta") defer insta.Export("goinsta.json")
record := db.NewRecord(username, url) record := db.NewRecord(username, url)
res, err := insta.Searchbar.SearchUser(username, true) res, err := insta.Searchbar.SearchUser(username, true)
if err != nil { if err != nil {
utils.Logger.Infof("Storing empty record to DB: Account doesn't exist")
record.URL = "" record.URL = ""
db.SaveRecord(record) db.SaveRecord(record)
return "" return ""
} }
if len(res.Users) == 0 || res.Users[0].Username != username { if len(res.Users) == 0 || res.Users[0].Username != username {
utils.Logger.Infof("Storing empty record to DB: Account not listed")
record.URL = "" record.URL = ""
db.SaveRecord(record) db.SaveRecord(record)
return "" return ""
} }
utils.Logger.Infof("Storing record %v to DB with url: %v", username, url)
db.SaveRecord(record) db.SaveRecord(record)
return url return url
} }