Add back in the GetUserByID unauthenticated operation since apparently it does actually work
This commit is contained in:
parent
2b7a636720
commit
c7a6b5b321
@ -285,7 +285,7 @@ func create_profile(target_dir string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func _fetch_user_by_id(id scraper.UserID) error {
|
func _fetch_user_by_id(id scraper.UserID) error {
|
||||||
user, err := api.GetUserByID(id)
|
user, err := scraper.GetUserByID(id)
|
||||||
if errors.Is(err, scraper.ErrDoesntExist) {
|
if errors.Is(err, scraper.ErrDoesntExist) {
|
||||||
// Mark them as deleted.
|
// Mark them as deleted.
|
||||||
// Handle and display name won't be updated if the user exists.
|
// Handle and display name won't be updated if the user exists.
|
||||||
|
@ -22,7 +22,7 @@ func (p Profile) SaveTweetTrove(trove TweetTrove, should_download bool, api *API
|
|||||||
"Conflicting user handle found (ID %d); old user has been marked deleted. Rescraping them\n",
|
"Conflicting user handle found (ID %d); old user has been marked deleted. Rescraping them\n",
|
||||||
conflict_err.ConflictingUserID,
|
conflict_err.ConflictingUserID,
|
||||||
)
|
)
|
||||||
user, err := api.GetUserByID(conflict_err.ConflictingUserID)
|
user, err := GetUserByID(conflict_err.ConflictingUserID)
|
||||||
if errors.Is(err, ErrDoesntExist) {
|
if errors.Is(err, ErrDoesntExist) {
|
||||||
// Mark them as deleted.
|
// Mark them as deleted.
|
||||||
// Handle and display name won't be updated if the user exists.
|
// Handle and display name won't be updated if the user exists.
|
||||||
|
@ -173,6 +173,15 @@ func ParseSingleUser(apiUser APIUser) (ret User, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calls API#GetUserByID and returns the parsed result
|
||||||
|
func GetUserByID(u_id UserID) (User, error) {
|
||||||
|
session, err := NewGuestSession() // This endpoint works better if you're not logged in
|
||||||
|
if err != nil {
|
||||||
|
return User{}, err
|
||||||
|
}
|
||||||
|
return session.GetUserByID(u_id)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a filename for the profile image, that hopefully won't clobber other ones
|
* Make a filename for the profile image, that hopefully won't clobber other ones
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user