|
|
|
@ -166,7 +166,7 @@ def profile_picture_reactions(profile, user, all_pictures, first_user=False, mod |
|
|
|
picture.date = profile.viewing().find("abbr").text |
|
|
|
picture.date = profile.viewing().find("abbr").text |
|
|
|
except Exception as e: # Fel8 |
|
|
|
except Exception as e: # Fel8 |
|
|
|
write_error(8, e=e, soup=profile.viewing(), url=pic, url_name='picture url', user=user.name, traceback=traceback.format_exc()) |
|
|
|
write_error(8, e=e, soup=profile.viewing(), url=pic, url_name='picture url', user=user.name, traceback=traceback.format_exc()) |
|
|
|
# TODO lägg till fler bilder som kan gås igenom. |
|
|
|
# TODO #3 lägg till fler bilder som kan gås igenom om det är få profilbilder. |
|
|
|
|
|
|
|
|
|
|
|
# Hämta länkar för bilden att userända sen |
|
|
|
# Hämta länkar för bilden att userända sen |
|
|
|
#print(profile.viewing().prettify()) |
|
|
|
#print(profile.viewing().prettify()) |
|
|
|
@ -192,7 +192,6 @@ def profile_picture_reactions(profile, user, all_pictures, first_user=False, mod |
|
|
|
for div in profile.viewing().find_all("div", href=True): |
|
|
|
for div in profile.viewing().find_all("div", href=True): |
|
|
|
if 'like this' in div.text: |
|
|
|
if 'like this' in div.text: |
|
|
|
url_reactions = url_bas + str(div["href"]) |
|
|
|
url_reactions = url_bas + str(div["href"]) |
|
|
|
# ISSUE Det är fortfarande inte alla bilder som får en url_reaction |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Hämta reaktioner för bilden |
|
|
|
# Hämta reaktioner för bilden |
|
|
|
sleep_(3) |
|
|
|
sleep_(3) |
|
|
|
@ -228,9 +227,7 @@ def profile_picture_reactions(profile, user, all_pictures, first_user=False, mod |
|
|
|
|
|
|
|
|
|
|
|
# Gå igenom alla som reagerat och för in i arango |
|
|
|
# Gå igenom alla som reagerat och för in i arango |
|
|
|
for li in profile.viewing().find_all("li"): |
|
|
|
for li in profile.viewing().find_all("li"): |
|
|
|
friend = Friend(user.username) |
|
|
|
friend = Friend(user.username, mode) |
|
|
|
if single == True: |
|
|
|
|
|
|
|
friend.single = True |
|
|
|
|
|
|
|
if "See more" in li.text: |
|
|
|
if "See more" in li.text: |
|
|
|
continue |
|
|
|
continue |
|
|
|
try: |
|
|
|
try: |
|
|
|
@ -250,8 +247,6 @@ def profile_picture_reactions(profile, user, all_pictures, first_user=False, mod |
|
|
|
# Lägg till vännens profil till arrango |
|
|
|
# Lägg till vännens profil till arrango |
|
|
|
friend.add_to_db() |
|
|
|
friend.add_to_db() |
|
|
|
|
|
|
|
|
|
|
|
# Lägg till reaktion till arrango |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
except AttributeError as e: # Fel1 |
|
|
|
except AttributeError as e: # Fel1 |
|
|
|
write_error( |
|
|
|
write_error( |
|
|
|
1, |
|
|
|
1, |
|
|
|
@ -262,7 +257,7 @@ def profile_picture_reactions(profile, user, all_pictures, first_user=False, mod |
|
|
|
) |
|
|
|
) |
|
|
|
pass |
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Lägg till reaktion till databasen |
|
|
|
db.collection("picture_reactions").insert_many( |
|
|
|
db.collection("picture_reactions").insert_many( |
|
|
|
picture.reactions, silent=True, overwrite=True |
|
|
|
picture.reactions, silent=True, overwrite=True |
|
|
|
) |
|
|
|
) |
|
|
|
@ -279,8 +274,6 @@ def profile_picture_reactions(profile, user, all_pictures, first_user=False, mod |
|
|
|
) |
|
|
|
) |
|
|
|
pass |
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
## ATT GÖRA För att lägga till fler reaktioner om det är få reaktioner på profilbilderna (måste uppdateras) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
user.checked() |
|
|
|
user.checked() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|