Skip to content

Commit ab020d9

Browse files
committed
2022.6.10.0
Instagram User ID
1 parent 4ba1624 commit ab020d9

5 files changed

Lines changed: 30 additions & 5 deletions

File tree

Changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 2022.6.10.0
2+
3+
**Attention! From now on, Instagram requires Cookies, Hash and authorization headers!**
4+
5+
- Fixed
6+
- Can't get Instagram user ID
7+
18
# 2022.6.6.0
29

310
- Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ The program has an intuitive interface.
121121

122122
You need to set up authorization for Twitter and Instagram:
123123
- Authorization [cookies](https://github.com/AAndyProgram/SCrawler/wiki/Settings#how-to-set-up-cookies) and [tokens](https://github.com/AAndyProgram/SCrawler/wiki/Settings#how-to-find-twitter-tokens) for **Twitter** (if you want to download data from Twitter)
124-
- Authorization [cookies](https://github.com/AAndyProgram/SCrawler/wiki/Settings#how-to-set-up-cookies) and [Hash](https://github.com/AAndyProgram/SCrawler/wiki/Settings#instagram) for **Instagram** (if you want to download data from Instagram), [Hash 2](https://github.com/AAndyProgram/SCrawler/wiki/Settings#how-to-find-instagram-hash-2) for **saved Instagram posts**, Instagram [stories authorization headers](https://github.com/AAndyProgram/SCrawler/wiki/Settings#how-to-find-instagram-stories-authorization-headers) for **Stories** and **Tagged data**
124+
- Authorization [cookies](https://github.com/AAndyProgram/SCrawler/wiki/Settings#how-to-set-up-cookies), [Hash](https://github.com/AAndyProgram/SCrawler/wiki/Settings#instagram) and [authorization headers](https://github.com/AAndyProgram/SCrawler/wiki/Settings#how-to-find-instagram-authorization-headers) for **Instagram** (if you want to download data from Instagram), [Hash 2](https://github.com/AAndyProgram/SCrawler/wiki/Settings#how-to-find-instagram-hash-2) for **saved Instagram posts**
125125

126126
Just add a user profile and **click the ```Start downloading``` button**.
127127

SCrawler/API/Instagram/UserData.vb

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ Namespace API.Instagram
536536
End Try
537537
End Sub
538538
#End Region
539-
Private Sub GetUserId()
539+
#Region "GetUserId"
540+
<Obsolete> Private Sub GetUserId_Old()
540541
Try
541542
Dim r$ = Responser.GetResponse($"https://www.instagram.com/{Name}/?__a=1",, EDP.ThrowException)
542543
If Not r.IsEmptyString Then
@@ -552,6 +553,23 @@ Namespace API.Instagram
552553
End If
553554
End Try
554555
End Sub
556+
Private Sub GetUserId()
557+
Try
558+
Dim r$ = Responser.GetResponse($"https://i.instagram.com/api/v1/users/web_profile_info/?username={Name}",, EDP.ThrowException)
559+
If Not r.IsEmptyString Then
560+
Using j As EContainer = JsonDocument.Parse(r).XmlIfNothing
561+
ID = j({"data", "user"}, "id").XmlIfNothingValue
562+
End Using
563+
End If
564+
Catch ex As Exception
565+
If Responser.StatusCode = HttpStatusCode.NotFound Or Responser.StatusCode = HttpStatusCode.BadRequest Then
566+
Throw ex
567+
Else
568+
LogError(ex, "get Instagram user id")
569+
End If
570+
End Try
571+
End Sub
572+
#End Region
555573
#Region "Pinned stories"
556574
Private Sub GetStoriesData(ByRef StoriesList As List(Of String), ByVal Token As CancellationToken)
557575
Const ReqUrl$ = "https://i.instagram.com/api/v1/feed/reels_media/?{0}"

SCrawler/API/Reddit/UserData.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ Namespace API.Reddit
730730
ElseIf Responser.StatusCode = HttpStatusCode.BadGateway Or
731731
Responser.StatusCode = HttpStatusCode.ServiceUnavailable Or
732732
Responser.StatusCode = HttpStatusCode.GatewayTimeout Then
733-
MyMainLOG = $"Reddit is currently unavailable ({ToString()})"
733+
MyMainLOG = $"[{CInt(Responser.StatusCode)}] Reddit is currently unavailable ({ToString()})"
734734
Else
735735
If Not FromPE Then LogError(ex, Message) : HasError = True
736736
Return 0

SCrawler/My Project/AssemblyInfo.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
3232
' by using the '*' as shown below:
3333
' <Assembly: AssemblyVersion("1.0.*")>
3434

35-
<Assembly: AssemblyVersion("2022.6.7.0")>
36-
<Assembly: AssemblyFileVersion("2022.6.7.0")>
35+
<Assembly: AssemblyVersion("2022.6.10.0")>
36+
<Assembly: AssemblyFileVersion("2022.6.10.0")>
3737
<Assembly: NeutralResourcesLanguage("en")>

0 commit comments

Comments
 (0)