Using InstaPy / UnicodeEncodeError?
when using InstaPy with the following code on Win10 i get an UnicodeEncodeError - (there are "_"signs in the name and password)
from dotenv import load_dotenv, find_dotenv
import os
from instapy import InstaPy
from importlib import reload
load_dotenv(find_dotenv())
INSTA_USER = os.environ.get("INSTA_USER")
INSTA_PW = os.environ.get("INSTA_PW")
session = InstaPy(username=INSTA_USER,
password=INSTA_PW,
headless_browser= True)
session.login()
session.like_by_tags(["wien"], amount=1)
Error:
--- Logging error ---
Traceback (most recent call last):
File "c:\users\polzi\appdata\local\programs\python\python39\lib\logging\__init__.py", line 1082, in emit
stream.write(msg + self.terminator)
File "c:\users\polzi\appdata\local\programs\python\python39\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u0308' in position 18868: character maps to <undefined>
Call stack:
File "C:\Users\Polzi\Documents\DEV\Python-Diverses\InstaPy\exmplInstaPy.py", line 15, in <module>
session.like_by_tags(["wien"], amount=1)
File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\instapy.py", line 1980, in like_by_tags
inappropriate, user_name, is_video, reason, scope = check_link(
File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\like_util.py", line 618, in check_link
logger.info("post_page: {}".format(post_page))
Message: "post_page: {'items': [{'taken_at': 1645977416, 'pk': 2782982736417357470, 'id': '2782982736417357470_10413942182', 'device_timestamp': 1645977415339, 'media_type': 8, 'code': 'CafJA3MM36e', 'client_cache_key': 'Mjc4Mjk4MjczNjQxNzM1NzQ3MA==.2', 'filter_type': 0, 'carousel_media_count': 3, 'carousel_media': [{'id': '2782982731744811142_10413942182',
'media_type': 1, 'image_versions2': {'candidates': [{'width': 480, 'height': 480, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274838151_1964041973783269_2424138370886350601_n.jpg?stp=dst-jpg_e15_s480x480&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=101&_nc_ohc=1nSF0m02QIkAX_rEjac&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4Mjk4MjczMTc0NDgxMTE0Mg%3D%3D.2-ccb7-4&oh=00_AT_GrkLy-zHx-sgYLaQcYMyyfmQ-TmqSCH9p87h0Xki3Ag&oe=62225C7C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 320, 'height': 320, 'url': 'https://scon
Traceback (most recent call last):
File "C:\Users\Polzi\Documents\DEV\Python-Diverses\InstaPy\exmplInstaPy.py", line 15, in <module>
session.like_by_tags(["wien"], amount=1)
File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\instapy.py", line 1980, in like_by_tags
inappropriate, user_name, is_video, reason, scope = check_link(
File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\like_util.py", line 619, in check_link
media = post_page[0]["shortcode_media"]
KeyError: 0
What can i do so this module is working?
(i want to give this library a try so i can like specific posts - but howerver the general fundamental liking process have to work first)
UnicodeEncodeError problem:
- go to this file
File "c:\users\polzi\appdata\local\programs\python\python39\lib\logging\__init__.py", line 1082, in emit stream.write(msg + self.terminator) - Add this option:
except UnicodeEncodeError: ____pass
KeyError problem: https://github.com/InstaPy/InstaPy/issues/6472#issuecomment-1035602599
I made the change in that file: "c:\users\polzi\appdata\local\programs\python\python39\lib\logging_init_.py"
changed to:
try:
msg = self.format(record)
stream = self.stream
# issue 35046: merged two stream.writes into one.
stream.write(msg + self.terminator)
self.flush()
except RecursionError: # See issue 36272
raise
except Exception:
self.handleError(record)
except UnicodeEncodeError:
____pass
But i think i get still the same error:
File "C:\Users\Polzi\Documents\DEV\Python-Diverses\InstaPy\exmplInstaPy.py", line 19, in <module>
session.like_by_tags(["wien"], amount=1)
File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\instapy.py", line 1980, in like_by_tags
inappropriate, user_name, is_video, reason, scope = check_link(
File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\like_util.py", line 618, in check_link
logger.info("post_page: {}".format(post_page))
Message: "post_page: {'items': [{'taken_at': 1646123346, 'pk': 2784206887430726628, 'id': '2784206887430726628_388740638', 'device_timestamp': 35750314241940, 'media_type': 1, 'code': 'CajfWmqgSPk', 'client_cache_key': 'Mjc4NDIwNjg4NzQzMDcyNjYyOA==.2', 'filter_type': 0, 'is_unified_video': False, 'location': {'pk': 100232032143091, 'short_name': 'Wien', 'facebook_places_id': 100232032143091, 'external_source': 'facebook_places', 'name': 'Wien, Österreich', 'address': '', 'city': 'Wien', 'has_viewer_saved': False, 'lng': 16.3731, 'lat': 48.2083, 'is_eligible_for_guides': True}, 'lat': 48.2083, 'lng': 16.3731, 'user': {'pk': 388740638, 'username': 'astral__panda', 'full_name': 'Panda 🐼', 'is_private': False, 'profile_pic_url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-19/274614606_955765511997709_6669601495607319668_n.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=101&_nc_ohc=QIhsmEPnGqwAX_eDTSi&edm=AABBvjUBAAAA&ccb=7-4&oh=00_AT-eeQSZnt6V_MDUpjKfBa2djaCQseu77dqpU0LhVeFaAA&oe=6225407F&_nc_sid=83d603',
0cmFja2VkIjp0cnVlLCJ1dWlkIjoiZjZiMzY5NTliMzlmNGYwN2JlYTgzNDNkMjI0NDFkYTAyNzg0MjA2ODg3NDMwNzI2NjI4Iiwic2VydmVyX3Rva2VuIjoiMTY0NjEyMzQwMjgwOHwyNzg0MjA2ODg3NDMwNzI2NjI4fDUxMDg2Njc3NzU3fDNkMzkzNjkxYjRhODUzOTJkYjExMDNkYTM0MjNmZDA0ZjA0NDhjNTMyY2M5MDVlMDU2MTAyZDAwYzFkZTM3NzAifSwic2lnbmF0dXJlIjoiIn0=', 'sharing_friction_info': {'should_have_sharing_friction': False, 'bloks_app_url': None}, 'comment_inform_treatment': {'should_have_inform_treatment': False, 'text': ''}, 'product_type': 'feed', 'is_in_profile_grid': False, 'profile_grid_control_enabled': False, 'deleted_reason': 0, 'integrity_review_decision': 'pending', 'music_metadata': {'music_canonical_id': '0', 'audio_type': None, 'music_info': None, 'original_sound_info': None}}], 'num_results': 1, 'more_available': False, 'auto_load_more_enabled': False}
Traceback (most recent call last):
File "C:\Users\Polzi\Documents\DEV\Python-Diverses\InstaPy\exmplInstaPy.py", line 19, in <module>
session.like_by_tags(["wien"], amount=1)
File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\instapy.py", line 1980, in like_by_tags
inappropriate, user_name, is_video, reason, scope = check_link(
File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\like_util.py", line 619, in check_link
media = post_page[0]["shortcode_media"]
KeyError: 0
I made the change in that file: "c:\users\polzi\appdata\local\programs\python\python39\lib\logging__init__.py"
changed to:
try: msg = self.format(record) stream = self.stream # issue 35046: merged two stream.writes into one. stream.write(msg + self.terminator) self.flush() except RecursionError: # See issue 36272 raise except Exception: self.handleError(record) except UnicodeEncodeError: ____passBut i think i get still the same error:
File "C:\Users\Polzi\Documents\DEV\Python-Diverses\InstaPy\exmplInstaPy.py", line 19, in <module> session.like_by_tags(["wien"], amount=1) File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\instapy.py", line 1980, in like_by_tags inappropriate, user_name, is_video, reason, scope = check_link( File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\like_util.py", line 618, in check_link logger.info("post_page: {}".format(post_page)) Message: "post_page: {'items': [{'taken_at': 1646123346, 'pk': 2784206887430726628, 'id': '2784206887430726628_388740638', 'device_timestamp': 35750314241940, 'media_type': 1, 'code': 'CajfWmqgSPk', 'client_cache_key': 'Mjc4NDIwNjg4NzQzMDcyNjYyOA==.2', 'filter_type': 0, 'is_unified_video': False, 'location': {'pk': 100232032143091, 'short_name': 'Wien', 'facebook_places_id': 100232032143091, 'external_source': 'facebook_places', 'name': 'Wien, Österreich', 'address': '', 'city': 'Wien', 'has_viewer_saved': False, 'lng': 16.3731, 'lat': 48.2083, 'is_eligible_for_guides': True}, 'lat': 48.2083, 'lng': 16.3731, 'user': {'pk': 388740638, 'username': 'astral__panda', 'full_name': 'Panda 🐼', 'is_private': False, 'profile_pic_url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-19/274614606_955765511997709_6669601495607319668_n.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=101&_nc_ohc=QIhsmEPnGqwAX_eDTSi&edm=AABBvjUBAAAA&ccb=7-4&oh=00_AT-eeQSZnt6V_MDUpjKfBa2djaCQseu77dqpU0LhVeFaAA&oe=6225407F&_nc_sid=83d603', 0cmFja2VkIjp0cnVlLCJ1dWlkIjoiZjZiMzY5NTliMzlmNGYwN2JlYTgzNDNkMjI0NDFkYTAyNzg0MjA2ODg3NDMwNzI2NjI4Iiwic2VydmVyX3Rva2VuIjoiMTY0NjEyMzQwMjgwOHwyNzg0MjA2ODg3NDMwNzI2NjI4fDUxMDg2Njc3NzU3fDNkMzkzNjkxYjRhODUzOTJkYjExMDNkYTM0MjNmZDA0ZjA0NDhjNTMyY2M5MDVlMDU2MTAyZDAwYzFkZTM3NzAifSwic2lnbmF0dXJlIjoiIn0=', 'sharing_friction_info': {'should_have_sharing_friction': False, 'bloks_app_url': None}, 'comment_inform_treatment': {'should_have_inform_treatment': False, 'text': ''}, 'product_type': 'feed', 'is_in_profile_grid': False, 'profile_grid_control_enabled': False, 'deleted_reason': 0, 'integrity_review_decision': 'pending', 'music_metadata': {'music_canonical_id': '0', 'audio_type': None, 'music_info': None, 'original_sound_info': None}}], 'num_results': 1, 'more_available': False, 'auto_load_more_enabled': False} Traceback (most recent call last): File "C:\Users\Polzi\Documents\DEV\Python-Diverses\InstaPy\exmplInstaPy.py", line 19, in <module> session.like_by_tags(["wien"], amount=1) File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\instapy.py", line 1980, in like_by_tags inappropriate, user_name, is_video, reason, scope = check_link( File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\like_util.py", line 619, in check_link media = post_page[0]["shortcode_media"] KeyError: 0
Delete all underscore before 'pass'. I wrote them only for show you that there is indention. In previous comment i drope link to the "KeyError" problem. Check it again.
Hello - i now changed this to
try:
msg = self.format(record)
stream = self.stream
# issue 35046: merged two stream.writes into one.
stream.write(msg + self.terminator)
self.flush()
except RecursionError: # See issue 36272
raise
except Exception:
self.handleError(record)
except UnicodeEncodeError:
pass
But i still get this error
--- Logging error ---
Traceback (most recent call last):
File "c:\users\polzi\appdata\local\programs\python\python39\lib\logging\__init__.py", line 1082, in emit
stream.write(msg + self.terminator)
File "c:\users\polzi\appdata\local\programs\python\python39\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 10798-10799: character maps to <undefined>
try change it like this: try: msg = self.format(record) stream = self.stream # issue 35046: merged two stream.writes into one. stream.write(msg + self.terminator) self.flush() except RecursionError: # See issue 36272 raise except UnicodeEncodeError: pass except Exception: self.handleError(record)
sorry, i don't able to write with indention
Hello - it seems that the inital error message disappears - but at the end there is still an error with the KeyError: 0
INFO [2022-03-01 16:06:22] [aunikat_wien] Links retrieved:: [33/https://www.instagram.com/p/CakMHtygqpm/]
INFO [2022-03-01 16:06:25] [aunikat_wien] Like# [1/10]
INFO [2022-03-01 16:06:25] [aunikat_wien] https://www.instagram.com/p/CakMwTPqmwb/
INFO [2022-03-01 16:06:28] [aunikat_wien] post_page: {'items': [{'taken_at': 1646147150, 'pk': 2784406565378747419, 'id': '2784406565378747419_4782696392', 'device_timestamp': 164614714954, 'media_type': 1, 'code': 'CakMwTPqmwb', 'client_cache_key': 'Mjc4NDQwNjU2NTM3ODc0NzQxOQ==.2', 'filter_type': 0, 'is_unified_video': False, 'user': {'pk': 4782696392, 'username': 'era.austria', 'full_name': 'ERA Austria', 'is_private': False, 'profile_pic_url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-19/17127170_269173850191528_2494924709582340096_a.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=104&_nc_ohc=-jrB8c4hMwMAX_g4_-7&edm=AABBvjUBAAAA&ccb=7-4&oh=00_AT9o7ICqxSfZQQsUsk70bKWvvFqJjcOZOGF7rdb8lw-yBQ&oe=622559D6&_nc_sid=83d603', 'profile_pic_id': '1466608110800994810_4782696392', 'friendship_status': {'following': False, 'outgoing_request': False, 'is_bestie': False, 'is_restricted': False, 'is_feed_favorite': False}, 'is_verified': False, 'follow_friction_type': 0, 'has_anonymous_profile_picture': False, 'is_unpublished': False, 'is_favorite': False, 'latest_reel_media': 0, 'has_highlight_reels': False}, 'can_viewer_reshare': True, 'caption_is_edited': False, 'like_and_view_counts_disabled': False, 'featured_products_cta': None, 'commerciality_status': 'not_commercial', 'is_paid_partnership': False, 'is_visual_reply_commenter_notice_enabled': True, 'original_media_has_visual_reply_media': False, 'comment_likes_enabled': True, 'comment_threading_enabled': True, 'has_more_comments': False, 'max_num_visible_preview_comments': 2, 'preview_comments': [], 'comments': [], 'can_view_more_preview_comments': False, 'comment_count': 0, 'hide_view_all_comment_entrypoint': False, 'inline_composer_display_condition': 'impression_trigger', 'image_versions2': {'candidates': [{'width': 828, 'height': 828, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e35_s828x828_sh0.08&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT_mvpKrK1RbinKxazlKeS6h8oaKz4_qwOM84kz6LoCKDw&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 1080, 'height': 1080, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e15_fr_s1080x1080&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT_vBkGTrcW-2M01uQF18QXgQuoNleZa9Qg6RHMjCPEPDA&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 750, 'height': 750, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e35_s750x750_sh0.08&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT_Ig6jt55M-BRFS_g1HZQfya-5JUu3XAKm_1Wc44pCioA&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 640, 'height': 640, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e35_s640x640_sh0.08&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT9pw7R_7_G56e9fuvOlqYzVnMuFcGpmovbZy9uah_DzEA&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 480, 'height': 480, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e15_s480x480&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT8igf1AZ4mwXJWXzdhk-8c4zRDmOwi-GopLSWaRC3AMYg&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 320, 'height': 320, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e15_s320x320&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT_JKOO7Hmb4DRPwtCvL8mnqJo9MThjaIBb5I_SX0Xpnzw&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 240, 'height': 240, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e15_s240x240&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT8P4pGvi3Dbs8BDSES9u3vP5b0LQSWQshNRTt_be3KUng&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 1080, 'height': 1080, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e15_fr_s1080x1080&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT_vBkGTrcW-2M01uQF18QXgQuoNleZa9Qg6RHMjCPEPDA&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 750, 'height': 750, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e35_s750x750_sh0.08&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT_Ig6jt55M-BRFS_g1HZQfya-5JUu3XAKm_1Wc44pCioA&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 640, 'height': 640, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e35_s640x640_sh0.08&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT9pw7R_7_G56e9fuvOlqYzVnMuFcGpmovbZy9uah_DzEA&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 480, 'height': 480, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e15_s480x480&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT8igf1AZ4mwXJWXzdhk-8c4zRDmOwi-GopLSWaRC3AMYg&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 320, 'height': 320, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e15_s320x320&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT_JKOO7Hmb4DRPwtCvL8mnqJo9MThjaIBb5I_SX0Xpnzw&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 240, 'height': 240, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e15_s240x240&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT8P4pGvi3Dbs8BDSES9u3vP5b0LQSWQshNRTt_be3KUng&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}, {'width': 150, 'height': 150, 'url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-15/274994884_385786402878188_8980335178988070716_n.jpg?stp=dst-jpg_e15_s150x150&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=XYtB676-hH4AX-7NjDG&edm=AABBvjUBAAAA&ccb=7-4&ig_cache_key=Mjc4NDQwNjU2NTM3ODc0NzQxOQ%3D%3D.2-ccb7-4&oh=00_AT-Zfm1k7YUVoiOcwVW6YIMjcy62LX94Y7Q_Trt8mIwrZg&oe=6224444C&_nc_sid=83d603', 'scans_profile': 'e15'}]}, 'original_width': 1080, 'original_height': 1080, 'like_count': 0, 'has_liked': False, 'top_likers': [], 'facepile_top_likers': [], 'likers': [], 'photo_of_you': False, 'can_see_insights_as_brand': False, 'caption': {'pk': 17845374131732164, 'user_id': 4782696392, 'text': 'Heute gibt es gleich zwei Gründe zum Feiern, denn am 1. März ist nicht nur meteorologischer Frühlingsbeginn, sondern heuer auch Faschingsdienstag! 😊 Passend dazu unser Spruch des Monats! 🥳\n\n#e
raaustria #era #eraimmobilien #spruchdesmonats #hallomärz #frühlingsbeginn #faschingsdienstag #fasching #spruch #immobilienmakler #immobilienexperte #immobilienwissen #immobilien
profi #wien #niederösterreich #burgenland #kärnten #salzburg #steiermark #oberösterreich #tirol #vorarlberg', 'type': 1, 'created_at': 1646147153, 'created_at_utc': 1646147153,
'content_type': 'comment', 'status': 'Active', 'bit_flags': 0, 'did_report_as_spam': False, 'share_enabled': False, 'user': {'pk': 4782696392, 'username': 'era.austria', 'full_name': 'ERA Austria', 'is_private': False, 'profile_pic_url': 'https://scontent-vie1-1.cdninstagram.com/v/t51.2885-19/17127170_269173850191528_2494924709582340096_a.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_cat=104&_nc_ohc=-jrB8c4hMwMAX_g4_-7&edm=AABBvjUBAAAA&ccb=7-4&oh=00_AT9o7ICqxSfZQQsUsk70bKWvvFqJjcOZOGF7rdb8lw-yBQ&oe=622559D6&_nc_sid=83d603', 'profile_pic_id': '1466608110800994810_4782696392', 'friendship_status': {'following': False, 'outgoing_request': False, 'is_bestie': False, 'is_restricted': False, 'is_feed_favorite': False}, 'is_verified': False, 'follow_friction_type': 0, 'has_anonymous_profile_picture': False, 'is_unpublished': False, 'is_favorite': False, 'latest_reel_media': 0, 'has_highlight_reels': False}, 'is_covered': False, 'media_id': 2784406565378747419, 'private_reply_status': 0}, 'can_viewer_save': True, 'organic_tracking_token': 'eyJ2ZXJzaW9uIjo1LCJwYXlsb2FkIjp7ImlzX2FuYWx5dGljc190cmFja2VkIjp0cnVlLCJ1dWlkIjoiY2Q4YTlmZGFjZmQyNDE0YzkzMzgzMjBiMjhkMTVkZDgyNzg0NDA2NTY1Mzc4NzQ3NDE5Iiwic2VydmVyX3Rva2VuIjoiMTY0NjE0NzE4NjkwM3wyNzg0NDA2NTY1Mzc4NzQ3NDE5fDUxMDg2Njc3NzU3fGU4YjMzNjRlYWJkNWYxOGY4YjBkMjhhZmExYzRlZWYwZTE4NjIyYmFkMzIxZDYwNGQwYzQ4NzAzZDAwMDBkNGEifSwic2lnbmF0dXJlIjoiIn0=', 'sharing_friction_info': {'should_have_sharing_friction': False, 'bloks_app_url': None}, 'comment_inform_treatment': {'should_have_inform_treatment': False, 'text': ''}, 'product_type': 'feed', 'is_in_profile_grid': False, 'profile_grid_control_enabled': False, 'deleted_reason': 0, 'integrity_review_decision': 'pending', 'music_metadata': {'music_canonical_id': '0', 'audio_type': None, 'music_info': None, 'original_sound_info': None}}], 'num_results': 1, 'more_available': False, 'auto_load_more_enabled': False}
Traceback (most recent call last):
File "C:\Users\Polzi\Documents\DEV\Python-Diverses\InstaPy\exmplInstaPy.py", line 19, in <module>
session.like_by_tags(["wien"], amount=1)
File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\instapy.py", line 1980, in like_by_tags
inappropriate, user_name, is_video, reason, scope = check_link(
File "C:\Users\Polzi\Documents\DEV\.venv\instapy\lib\site-packages\instapy\like_util.py", line 619, in check_link
media = post_page[0]["shortcode_media"]
KeyError: 0
hey man, did you see this link? https://github.com/InstaPy/InstaPy/issues/6472#issuecomment-1035602599
thanks a lot - with also adding changing the code from #6472 it now works