Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] too many values to unpack (expected 2) #1837

Closed
tajbowness opened this issue Mar 11, 2024 · 2 comments
Closed

[BUG] too many values to unpack (expected 2) #1837

tajbowness opened this issue Mar 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tajbowness
Copy link
Contributor

tajbowness commented Mar 11, 2024

File "/home/IGAM/do_actions.py", line 98, in like
cl.media_like(media)
File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/media.py", line 407, in media_like
media_id = self.media_pk(media_id)
File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/media.py", line 82, in media_pk
media_pk, _ = media_id.split("_")
ValueError: too many values to unpack (expected 2)

Possible Solution
Removing the ", " from "media_pk, _ = media_id.split("") " solves the issue.

Media Dict Info (To Test)
(Info gotten from timeline feed)

{'taken_at': 1708478351, 'pk': 3307278577288067651, 'id': '3307278577288067651_63510424646_mccr40091ae1', 'device_timestamp': 1708478351, 'client_cache_key': 'MzMwNzI3ODU3NzI4ODA2NzY1MQ==.2', 'filter_type': 0, 'caption_is_edited': False, 'like_and_view_counts_disabled': False, 'strong_id__': '3307278577288067651_63510424646', 'is_reshare_of_text_post_app_media_in_ig': False, 'is_post_live_clips_media': False, 'deleted_reason': 0, 'integrity_review_decision': 'pending', 'has_shared_to_fb': 0, 'expiring_at': 1709866886, 'is_unified_video': False, 'should_request_ads': False, 'is_visual_reply_commenter_notice_enabled': True, 'commerciality_status': 'not_commercial', 'explore_hide_comments': False, 'comment_threading_enabled': True, 'has_delayed_metadata': False, 'is_quiet_post': False, 'mezql_token': '', 'shop_routing_user_id': None, 'can_see_insights_as_brand': False, 'is_organic_product_tagging_eligible': False, 'has_liked': False, 'has_privately_liked': False, 'like_count': 33, 'top_likers': [], 'media_type': 1, 'code': 'C3l0Ffkg7pD', 'can_viewer_reshare': True, 'caption': {'bit_flags': 0, 'created_at': 1708478352, 'created_at_utc': 1708478352, 'did_report_as_spam': False, 'is_ranked_comment': False, 'pk': '18042626611651335', 'share_enabled': False, 'content_type': 'comment', 'media_id': 3307278577288067651, 'status': 'Active', 'type': 1, 'user_id': 63510424646, 'text': 'We have consulted with over 10,000 companies.\nWith our extensive research of 500+ frozen food, we will be able to suggest you the ARTLOCK freezer that is the most suited for your needs.\nContact us today to purchase your Flash Freezer', 'user': {'fbid_v2': '17841463379398803', 'feed_post_reshare_disabled': False, 'full_name': 'Day Break Co.Ltd', 'id': '63510424646', 'is_private': False, 'is_unpublished': True, 'pk': 63510424646, 'pk_id': '63510424646', 'show_account_transparency_details': True, 'strong_id__': '63510424646', 'third_party_downloads_enabled': 0, 'username': 'daybreak3145', 'account_badges': [], 'fan_club_info': {'fan_club_id': None, 'fan_club_name': None, 'is_fan_club_referral_eligible': None, 'fan_consideration_page_revamp_eligiblity': None, 'is_fan_club_gifting_eligible': None, 'subscriber_count': None, 'connected_member_count': None, 'autosave_to_exclusive_highlight': None, 'has_enough_subscribers_for_ssc': None}, 'friendship_status': {'following': False, 'is_muting_reel': False, 'is_bestie': False, 'is_restricted': False, 'is_feed_favorite': False}, 'has_anonymous_profile_picture': False, 'is_favorite': False, 'is_verified': False, 'latest_reel_media': 0, 'profile_pic_id': '3246389221091137494_63510424646', 'profile_pic_url': 'https://scontent.cdninstagram.com/v/t51.2885-19/405506238_3261368264156069_1106391298782490922_n.jpg?stp=dst-jpg_e0_s150x150&_nc_ht=scontent.cdninstagram.com&_nc_cat=105&_nc_ohc=ZOdfU7XS990AX8H93O9&edm=AJ9x6zYBAAAA&ccb=7-5&oh=00_AfC7P46mHkTxHCq5hVBHTuf4YL1D0xhzS5LtnSnYTUWXjA&oe=65EE6834&_nc_sid=65462d', 'transparency_product_enabled': False}, 'is_covered': False, 'private_reply_status': 0, 'hide_username': True}, 'clips_tab_pinned_user_ids': [], 'comment_inform_treatment': {'should_have_inform_treatment': False, 'text': '', 'url': None, 'action_type': None}, 'fundraiser_tag': {'has_standalone_fundraiser': False}, 'sharing_friction_info': {'should_have_sharing_friction': False, 'bloks_app_url': None, 'sharing_friction_payload': None}, 'original_media_has_visual_reply_media': False, 'fb_user_tags': {'in': []}, 'invited_coauthor_producers': [], 'can_viewer_save': True, 'preview': 'ACoq6Wo3lWP72frUlRyqx+6dvrxmgBn2lOvOD7GlFwhO0ZznHQ1CN3/PQZ+nFSqr5zvyvpj+tAFiikzRQAVXmYk7e1Wao3A2tuPQ4x9emP8ACpl0KiNlZVG305J9KghuMnC5POfQAdvrUbxbwQ3HX+YIz7cUxQMhcsCcYXPHH9B/9apZokjYBpc00dKK1MCemsgcbWGQadRSGZj2ZQ/KzbfTNPhthHyP8T+Zq/SUlFDcmR4pdtPpaok//9k=', 'is_in_profile_grid': False, 'profile_grid_control_enabled': False, 'featured_products': [], 'is_comments_gif_composer_enabled': True, 'product_suggestions': [], 'user': {'fbid_v2': '17841463379398803', 'feed_post_reshare_disabled': False, 'full_name': 'Day Break Co.Ltd', 'id': '63510424646', 'is_private': False, 'is_unpublished': True, 'pk': 63510424646, 'pk_id': '63510424646', 'show_account_transparency_details': True, 'strong_id__': '63510424646', 'third_party_downloads_enabled': 0, 'username': 'daybreak3145', 'account_badges': [], 'fan_club_info': {'fan_club_id': None, 'fan_club_name': None, 'is_fan_club_referral_eligible': None, 'fan_consideration_page_revamp_eligiblity': None, 'is_fan_club_gifting_eligible': None, 'subscriber_count': None, 'connected_member_count': None, 'autosave_to_exclusive_highlight': None, 'has_enough_subscribers_for_ssc': None}, 'friendship_status': {'following': False, 'is_muting_reel': False, 'is_bestie': False, 'is_restricted': False, 'is_feed_favorite': False}, 'has_anonymous_profile_picture': False, 'is_favorite': False, 'is_verified': False, 'latest_reel_media': 0, 'profile_pic_id': '3246389221091137494_63510424646', 'profile_pic_url': 'https://scontent.cdninstagram.com/v/t51.2885-19/405506238_3261368264156069_1106391298782490922_n.jpg?stp=dst-jpg_e0_s150x150&_nc_ht=scontent.cdninstagram.com&_nc_cat=105&_nc_ohc=ZOdfU7XS990AX8H93O9&edm=AJ9x6zYBAAAA&ccb=7-5&oh=00_AfC7P46mHkTxHCq5hVBHTuf4YL1D0xhzS5LtnSnYTUWXjA&oe=65EE6834&_nc_sid=65462d', 'transparency_product_enabled': False}, 'image_versions2': {'candidates': [{'url': 'https://scontent.cdninstagram.com/v/t51.2885-15/426195650_120205315280070061_3104175177245313441_n.jpg?stp=dst-jpg_e15&_nc_ht=scontent.cdninstagram.com&_nc_cat=101&_nc_ohc=wQ6YkOJu8H4AX9kgJSd&edm=AJ9x6zYBAAAA&ccb=7-5&oh=00_AfBYNZLUyAwYOfpsUy-ibf3tR4gdC9D8US7u9gk_FFPtlQ&oe=65EDDFFA&_nc_sid=65462d', 'width': 1080, 'height': 1080}]}, 'original_width': 1080, 'original_height': 1080, 'enable_media_notes_production': False, 'product_type': 'ad', 'is_paid_partnership': False, 'music_metadata': None, 'item_client_gap_rules': {'time_based_insertion_gap_in_seconds': 15.0, 'push_up_min_gap': 3, 'enable_user_engagement_base_insertion': False, 'user_engagement_based_insertion_settings': None, 'predicted_xout_rate': None, 'max_xout_prediction_threshold': None, 'post_gap_to_previous_ad': 4, 'post_gap_to_previous_netego': 1}, 'organic_tracking_token': 'eyJ2ZXJzaW9uIjo1LCJwYXlsb2FkIjp7ImlzX2FuYWx5dGljc190cmFja2VkIjpmYWxzZSwidXVpZCI6ImJmOWNkYzAxNGY3MDQ0ZTViMWI4YzhlNjg1MDJiNGE1MzMwNzI3ODU3NzI4ODA2NzY1MSIsInNlcnZlcl90b2tlbiI6IjE3MDk3ODA0ODY1ODh8MzMwNzI3ODU3NzI4ODA2NzY1MXw2MjE2ODU1ODYyN3w1YTdmYjRjZWYzM2Y2OWU1M2NhMjg2ZjNkNmNhMDE2ZWRkOTAwYmY4MDc3NjFlZjY0ZDRmNGJkN2I0NTA1MmI5In0sInNpZ25hdHVyZSI6IiJ9', 'ig_media_sharing_disabled': False, 'boost_unavailable_identifier': None, 'boost_unavailable_reason': None, 'open_carousel_submission_state': 'closed', 'is_open_to_public_submission': False, 'max_num_visible_preview_comments': 2, 'has_more_comments': True, 'preview_comments': [], 'comment_count': 2, 'can_view_more_preview_comments': False, 'hide_view_all_comment_entrypoint': False, 'is_auto_created': False, 'is_cutout_sticker_allowed': False, 'is_reuse_allowed': False, 'owner': {'fbid_v2': '17841463379398803', 'feed_post_reshare_disabled': False, 'full_name': 'Day Break Co.Ltd', 'id': '63510424646', 'is_private': False, 'is_unpublished': True, 'pk': 63510424646, 'pk_id': '63510424646', 'show_account_transparency_details': True, 'strong_id__': '63510424646', 'third_party_downloads_enabled': 0, 'username': 'daybreak3145', 'account_badges': [], 'fan_club_info': {'fan_club_id': None, 'fan_club_name': None, 'is_fan_club_referral_eligible': None, 'fan_consideration_page_revamp_eligiblity': None, 'is_fan_club_gifting_eligible': None, 'subscriber_count': None, 'connected_member_count': None, 'autosave_to_exclusive_highlight': None, 'has_enough_subscribers_for_ssc': None}, 'friendship_status': {'following': False, 'is_muting_reel': False, 'is_bestie': False, 'is_restricted': False, 'is_feed_favorite': False}, 'has_anonymous_profile_picture': False, 'is_favorite': False, 'is_verified': False, 'latest_reel_media': 0, 'profile_pic_id': '3246389221091137494_63510424646', 'profile_pic_url': 'https://scontent.cdninstagram.com/v/t51.2885-19/405506238_3261368264156069_1106391298782490922_n.jpg?stp=dst-jpg_e0_s150x150&_nc_ht=scontent.cdninstagram.com&_nc_cat=105&_nc_ohc=ZOdfU7XS990AX8H93O9&edm=AJ9x6zYBAAAA&ccb=7-5&oh=00_AfC7P46mHkTxHCq5hVBHTuf4YL1D0xhzS5LtnSnYTUWXjA&oe=65EE6834&_nc_sid=65462d', 'transparency_product_enabled': False}, 'injected': {'about_ad_params': '', 'actor_id': 7044377125620227, 'ad_id': 120206162797940061, 'ad_title': 'Day Break Co.Ltd', 'ads_debug_info': {'adsBidInfo': {'ecpmBid': 332.9792604000319, 'ecpmPrice': 316.382703, 'ectr': 0.0038701303337044285, 'ecvr': 2.481162254903892e-06, 'postImpEcvr': 248, 'organicBidInfo': {'organicBidCpm': -0.16520746055035423, 'userDollarValue': 100.0, 'serializedPacedOrganicBidMap': '{"AD_EVENT_TYPE_IMPRESSION_DUMMY":-0.165207}', 'serializedOrganicEventProbMap': '{"AD_EVENT_TYPE_IMPRESSION_DUMMY":1}', 'serializedEventQualityMap': '{"AD_EVENT_TYPE_IMPRESSION_DUMMY":-0.165207}', 'serializedImpOrganicBidMap': '{"AD_EVENT_TYPE_REPETITION":0,"AD_EVENT_TYPE_AD_REPORT_OVER_HIDE_SCORE":-0.003401,"AD_EVENT_TYPE_QUALITY_BID_OFFSET":0.0085,"AD_EVENT_TYPE_LANDING_PAGE_DOMAIN_PENALTY":0,"AD_EVENT_TYPE_BI_MLEX_GROUP_PENALTY":0,"AD_EVENT_TYPE_IMP_BASED_FEEDBACK_DISLIKE":-0.166862,"AD_EVENT_TYPE_OOPS_BAD_AD_PENALTY":0,"AD_EVENT_TYPE_BI_LQWE_PAGE_PENALTY":0,"AD_EVENT_TYPE_IMP_BASED_FEEDBACK_DISLIKE_REPETITIVE":-0.004819,"AD_EVENT_TYPE_BI_CLICKBAIT_PENALTY":0,"AD_EVENT_TYPE_BI_AD_FARM_PENALTY":0,"AD_EVENT_TYPE_BI_ENGAGEMENT_BAIT_V0_PENALTY":0,"AD_EVENT_TYPE_BI_SENSATIONALISM_V0_PENALTY":0,"AD_EVENT_TYPE_RESOURCE_AWARE_RANKING_PENALTY":0.000189,"AD_EVENT_ASQ_RELEVANCE":-0.001927,"AD_EVENT_TYPE_PURCHASE_SENTIMENT_BID":0,"AD_EVENT_TYPE_UNIFIED_OOPS_DELIVERY":0.00045,"AD_EVENT_TYPE_DWELL_TRIG_AFI_SEE_MORE":0.001163,"AD_EVENT_TYPE_PURCHASE_SENTIMENT_BID_MEASUREMENT":0,"AD_EVENT_TYPE_PURCHASE_SENTIMENT_QUALITY_COEFF":0,"AD_EVENT_TYPE_PAGE_HARM_BID":0,"AD_EVENT_TYPE_PNFR_BID":0,"AD_EVENT_TYPE_NP2P_CONSTANT_SUBSIDY_BID":0,"AD_EVENT_TYPE_IG_AFI_POST_CLICK_SEE_MORE_CATEGORICAL_CONTROL":0,"AD_EVENT_TYPE_IG_AFI_POST_CLICK_SEE_LESS_CATEGORICAL_CONTROL":0,"AD_EVENT_TYPE_INTENT_AWARE_ENGAGEMENT_CATEGORICAL_CONTROL":0,"AD_EVENT_TYPE_NON_ENGAGEMENT_HISTORY":0.0015,"AD_EVENT_TYPE_LEAD_ADS_QUALITY_SUBSIDY":0,"AD_EVENT_TYPE_AGGREGATED_SUBSIDY_FROM_ADPUBLISHER":0,"AD_EVENT_TYPE_CTX_SUBSIDY":0,"AD_EVENT_TYPE_IG_PROFILE_VISIT_SUBSIDY":0,"AD_EVENT_TYPE_RETENTION_SUBSIDY":0,"AD_EVENT_TYPE_PAYMENT_GATEWAY_SUBSIDY":0,"AD_EVENT_TYPE_SOT_SUBSIDY":0}', 'serializedImpOrganicCoeffMap': None, 'serializedImpOrganicScoreMap': '{"AD_EVENT_TYPE_REPETITION":0,"AD_EVENT_TYPE_AD_REPORT_OVER_HIDE_SCORE":0.090683,"AD_EVENT_TYPE_QUALITY_BID_OFFSET":1,"AD_EVENT_TYPE_LANDING_PAGE_DOMAIN_PENALTY":0,"AD_EVENT_TYPE_BI_MLEX_GROUP_PENALTY":0,"AD_EVENT_TYPE_IMP_BASED_FEEDBACK_DISLIKE":0.001963,"AD_EVENT_TYPE_OOPS_BAD_AD_PENALTY":0.032829,"AD_EVENT_TYPE_BI_LQWE_PAGE_PENALTY":0,"AD_EVENT_TYPE_IMP_BASED_FEEDBACK_DISLIKE_REPETITIVE":0.000262,"AD_EVENT_TYPE_BI_CLICKBAIT_PENALTY":0,"AD_EVENT_TYPE_BI_AD_FARM_PENALTY":0,"AD_EVENT_TYPE_BI_ENGAGEMENT_BAIT_V0_PENALTY":0,"AD_EVENT_TYPE_BI_SENSATIONALISM_V0_PENALTY":0,"AD_EVENT_TYPE_RESOURCE_AWARE_RANKING_PENALTY":-3.8e-5,"AD_EVENT_ASQ_RELEVANCE":-0.362208,"AD_EVENT_TYPE_PURCHASE_SENTIMENT_BID":0.729337,"AD_EVENT_TYPE_UNIFIED_OOPS_DELIVERY":-0.003,"AD_EVENT_TYPE_DWELL_TRIG_AFI_SEE_MORE":0.116256,"AD_EVENT_TYPE_PURCHASE_SENTIMENT_BID_MEASUREMENT":0.817017,"AD_EVENT_TYPE_PURCHASE_SENTIMENT_QUALITY_COEFF":-0.070663,"AD_EVENT_TYPE_PAGE_HARM_BID":0.035679,"AD_EVENT_TYPE_PNFR_BID":0,"AD_EVENT_TYPE_NP2P_CONSTANT_SUBSIDY_BID":0,"AD_EVENT_TYPE_IG_AFI_POST_CLICK_SEE_MORE_CATEGORICAL_CONTROL":0,"AD_EVENT_TYPE_IG_AFI_POST_CLICK_SEE_LESS_CATEGORICAL_CONTROL":0,"AD_EVENT_TYPE_INTENT_AWARE_ENGAGEMENT_CATEGORICAL_CONTROL":0,"AD_EVENT_TYPE_NON_ENGAGEMENT_HISTORY":-0.2,"AD_EVENT_TYPE_LEAD_ADS_QUALITY_SUBSIDY":1,"AD_EVENT_TYPE_AGGREGATED_SUBSIDY_FROM_ADPUBLISHER":1,"AD_EVENT_TYPE_CTX_SUBSIDY":1,"AD_EVENT_TYPE_IG_PROFILE_VISIT_SUBSIDY":1,"AD_EVENT_TYPE_RETENTION_SUBSIDY":1,"AD_EVENT_TYPE_PAYMENT_GATEWAY_SUBSIDY":0,"AD_EVENT_TYPE_SOT_SUBSIDY":1}'}}, 'adsRankingInfo': {'organicRank': 16, 'ecpsBidRank': 96, 'totalBidRank': 98}}, 'app_id': 0, 'brs_threshold': 90, 'campaign_id': 120205342799460061, 'creation_source': 'ADS_MANAGER', 'display_viewability_eligible': False, 'fb_app_id': 0, 'hide_label': 'Hide this', 'imp_signature': 45698, 'is_app_mae_ad_exclusion_eligible': False, 'is_demo': False, 'is_feed_glados_control_eligible': None, 'is_form_extension_eligible': False, 'is_holdout': False, 'is_luxury_vertical_ad': False, 'is_pharma_vertical_ad': False, 'is_pharma_and_sensitive_vertical_ad': False, 'lead_gen_new_experience_ineligible': False, 'pac_ad_media_ids': None, 'page_id': 158315960706531, 'phone_number': None, 'show_icon': True, 'view_tags': [], 'iab_post_click_data': {'impressionTime': 1709780486, 'eligibleExperienceTypes': [], 'iabPostClickDisclaimers': [], 'metaCheckoutIABPostClickDataExtension': None, 'buyWithPrimeIABPostClickDataExtension': None, 'promoAdsAutofillPostClickDataExtension': None, 'metaPaymentsSDKIABPostClickDataExtension': None}, 'label': 'Sponsored', 'show_ad_choices': False, 'sponsored_ad_disclaimer': None, 'tracking_token': 'AI@AQKey9_8F1xdBY7-ruvVWXxSKmFwcx5i7GcsGwYfRkGowbqpz3h_roBMd1icKic13752EKGUskKw7oeVRwQC24X54dYE6Ddx5lweIsWqTUbrnA', 'direct_share': True, 'media_id': 3307278577288067651, 'should_show_secondary_cta_on_profile': False, 'invalidation_rules': {'meta_ids': ['ad_id'], 'local_surface': [{'instruction': {'signal': 'seen', 'conditions': [{'lhs': 'dwelltime', 'comparator': 'ge', 'rhs': 250}, {'lhs': 'time', 'comparator': 'le', 'rhs': 7200000}]}}, {'instruction': {'signal': 'x-out'}}, {'instruction': {'signal': 'ads_pool'}}, {'instruction': {'signal': 'ads_inserted'}}, {'instruction': {'signal': 'app_install'}}]}, 'is_shops_ifu_eligible': False, 'is_bau_ifu_eligible': False, 'is_boosted': None, 'hide_reasons_v2': [{'text': "It's not relevant", 'reason': 'NOT_RELEVANT'}, {'text': 'I see it too often', 'reason': 'KEEP_SEEING_THIS'}, {'text': "It's inappropriate", 'reason': None}], 'hide_flow_type': 2, 'cookies': ['fr=0CMYmsdA1l6BS2cSO.AWVqwmbVq9Y8KEk1Xs6-Zc5BJjg.Bl6S4G..AAA.0.0.Bl6S4G.AWU27nkLvY0; Expires=Wed, 05 Jun 2024 03:01:26 GMT; Max-Age=7776000; Path=/; Domain=.facebook.com; SameSite=None; Secure; HttpOnly'], 'click_to_direct_lead_gen_ads_info': {'isLeadGenAd': False}, 'ctd_ads_info': {'business_responsiveness_time_text': None, 'welcome_message_text': None, 'business_response_time_in_sec': None}, 'ctj_ads_info': {'ig_channel_id': None, 'invite_link': None, 'number_of_members': None, 'channel_name': None}, 'is_multi_ads_eligible': True, 'ig_ad_rendering_cta_trust_info_data': None, 'ig_pbia_profile_and_browse_info': None, 'global_position': 3, 'is_post_click_afi_eligible': True, 'afi_info': {'is_feed_post_click_afi_eligible': True, 'is_feed_dwell_afi_eligible': False, 'interests_reco_info': None}, 'is_consent_growth_ifu_eligible': False, 'is_consent_growth_popup_eligible': False, 'adtaxon_i18n_top1_l7_prediction': 'Products//Business & Industrial//Food Service', 'post_trigger_experience_eligibilities': [], 'ad_pod_rules': None, 'iab': {'persistent_iab': {'should_disable': False}, 'browser_peek': None}, 'cop_render_output': None}, 'is_sensitive_vertical_ad': False, 'collapse_comments': True, 'ad_metadata': [{'value': 'artlockfreezer.com', 'type': 1}], 'link': 'https://artlockfreezer.com/en/what-is-flash-freezing-short?utm_source=facebook&utm_medium=ig&utm_campaign=Ana%EF%BD%9C%E6%B5%B7%E5%A4%96%E6%A4%9C%E8%A8%BC%EF%BC%88%E4%B8%AD%E5%9B%BD%EF%BC%89&utm_content=%E4%B8%AD%E5%9B%BD%E6%A4%9C%E8%A8%BC&fbclid=PAAaZqVQlql7TXWGlC2LFyGBxOMRRFTaRzo3NiFTW093qFzshVmAMBSrQw8JA_aem_AZntMBrHIAUrvSUghrcV1Wyb-wuHahxNdUfOroDQfpP1kY6quE7mEm88w5j_00BuZVpMZcZ59rSStq7qTy2xFTqW', 'link_text': 'Learn more', 'ctd_cta_localization_variants': None, 'ctwa_chat_on_whatsapp_localization_text': None, 'bm_cta_content_3_variants': None, 'ad_action': 'webclick', 'link_hint_text': 'Tap Photo to Open Page', 'iTunesItem': None, 'ad_link_type': 0, 'ad_header_style': 0, 'dr_ad_type': 1, 'android_links': [{'linkType': 1, 'webUri': 'https://artlockfreezer.com/en/what-is-flash-freezing-short?utm_source=facebook&utm_medium=ig&utm_campaign=Ana%EF%BD%9C%E6%B5%B7%E5%A4%96%E6%A4%9C%E8%A8%BC%EF%BC%88%E4%B8%AD%E5%9B%BD%EF%BC%89&utm_content=%E4%B8%AD%E5%9B%BD%E6%A4%9C%E8%A8%BC&fbclid=PAAaZqVQlql7TXWGlC2LFyGBxOMRRFTaRzo3NiFTW093qFzshVmAMBSrQw8JA_aem_AZntMBrHIAUrvSUghrcV1Wyb-wuHahxNdUfOroDQfpP1kY6quE7mEm88w5j_00BuZVpMZcZ59rSStq7qTy2xFTqW', 'androidClass': '', 'package': '', 'deeplinkUri': '', 'callToActionTitle': '', 'redirectUri': 'https://www.facebook.com/ads/ig_redirect/?d=Ad-UjREx_ZjRgKeN7RHfWtfd1Pis4XGUj84YFdFys1hcCd0lIvd3ly5LCOdGlbF1XzgKSXKwSZjyWUV_YFoL80cxRI_knqGOFsBDM01zFghQYM17F4XjmE7Jlhd9Ye0YPYK0nar_AnnjWuaFKzp2Fw8p7OGmBBptfRvGE4M1nu6Me70CZbbg_T_ktYiMRHLRSB2T2y3OK2zuqDRIk5L5ZuItVCLns4KhN7eBxuHmiFuSpoZtsPXKTruzqCjRYzsJkvTHrFpLXKY7BT-dh6B83WKmvlzaBh8XYvHoMVmL28tKdIeG6Ag5BiqC8_GMM7EYjfo2bgN5I3ablqrmIxGODnSRYxtwzcpXDs0nIIKUrnqDN2SK2Sx01rgfC8Pt_gfimY5uYKZEAl-lBQZW-UVsr2YTlBx4VPr50Y16re1_X-mWDKOO4wLihTVMf2hEzsDSzvzcwrgP39Qjv0gFqiNIggbz2ZFRftgN3W8gCFzAz_XJeh7Tk3UzIRxy0gbVO9aikrswrPMR5XZffEwaGNpwhzoWGcjFPLQidn0BdNRzzdO52ySSvdzQBqJVJWQsiAknzRmAhQgx2WBoF6sPcfPDwHb7QJRFCC0jG19zJUvCjTsqM0dqAMqva5utTddyKxyWaNSnVIVnQlyHMVdLi5D8zfJXXrUuNLnaicJSw3XhAEBWX0Xv5vzU-L3k0Deo2i-CTPGNYyJcU-IHKLJ0MtP5NK7Daoo3gUaeVwiwupeq_kiUClg9XxfNfjYY7-3bAip8C0mi603_JuWuOEPQcsGUQb7qH-zKrg0vpbRULjjQfS66m_PmP1FxbaN1QkTIyPo6ZiBMhGqkI52l450jRtONpOMdmRqcbytTNpLwUfq-Pd1otIqVg_MOhtTRgQOI_DK9p1xKusLC7cnl9ykF2PG5lJbsTEsJcSa32Zm9lSNyD5GJUXXTmx1-BqRY3XrJV88pVuNH7By4c0nLK6MAQagkCY5U&a=1&hash=Ad-rtKw4YCFrEEK0Fz0', 'leadGenFormId': None, 'igUserId': None, 'appInstallObjectiveInvalidationBehavior': None, 'referrerData': None, 'isAndroidAppLink': None, 'productPageId': None, 'appId': None, 'isVtOdirEligible': None, 'funnelId': None, 'funnelPurpose': None, 'playableUri': None, 'appName': None}], 'iab_autofill_optout_info': {'domain': '', 'is_iab_autofill_optout': False}, 'click_id': 'PAAaZqVQlql7TXWGlC2LFyGBxOMRRFTaRzo3NiFTW093qFzshVmAMBSrQw8JA_aem_AZntMBrHIAUrvSUghrcV1Wyb-wuHahxNdUfOroDQfpP1kY6quE7mEm88w5j_00BuZVpMZcZ59rSStq7qTy2xFTqW', 'force_overlay': True, 'hide_nux_text': True, 'overlay_text': 'Go to website', 'overlay_title': 'Day Break Co.Ltd', 'overlay_subtitle': 'Go to artlockfreezer.com', 'appstore_metadata': None, 'ctm_ads_info': None, 'dominant_color': '#6E2121', 'original_dominant_color': '#6E2121', 'fb_page_url': 'https://www.facebook.com/158315960706531', 'ad_tag': {'ad_id': 120206162797940061, 'title': 'Learn more'}, 'ad_demotion_control': {'title': 'Not Interested', 'enable_word_wrapping': True, 'confirmation_icon': 'none', 'title_style': 'normal', 'confirmation_title': 'Ad hidden', 'confirmation_body': 'Any other feedback?', 'confirmation_title_style': 'large_left', 'undo_style': 'top_right', 'confirmation_style': 'tombstone_v2', 'followup_options': [{'text': 'This ad is irrelevant to me', 'id': 'ad_irrelevant', 'show_icon': True, 'style': None, 'data': None, 'demotion_control': {'confirmation_style': 'tombstone_v2', 'confirmation_icon': 'checkmark', 'confirmation_title': '', 'confirmation_body': 'Hiding ads and leaving feedback lets us know what not to show you in the future.', 'undo_style': 'row'}}, {'text': 'I see this ad too often', 'id': 'ad_too_often', 'show_icon': True, 'style': None, 'data': None, 'demotion_control': {'confirmation_style': 'tombstone_v2', 'confirmation_icon': 'checkmark', 'confirmation_title': '', 'confirmation_body': 'Hiding ads and leaving feedback lets us know what not to show you in the future.', 'undo_style': 'row'}}, {'text': 'This ad is inappropriate', 'id': 'ad_inappropriate', 'show_icon': True, 'style': None, 'data': None, 'demotion_control': {'confirmation_style': 'tombstone_v2', 'confirmation_icon': 'checkmark', 'confirmation_title': '', 'confirmation_body': 'Hiding ads and leaving feedback lets us know what not to show you in the future.', 'undo_style': 'row'}}, {'text': 'I already bought an item in this ad', 'id': 'ad_already_bought', 'show_icon': True, 'style': None, 'data': None, 'demotion_control': {'confirmation_style': 'tombstone_v2', 'confirmation_icon': 'checkmark', 'confirmation_title': '', 'confirmation_body': 'Hiding ads and leaving feedback lets us know what not to show you in the future.', 'undo_style': 'row'}}]}, 'inventory_source': 'media_or_ad', 'is_seen': False, 'is_eof': False, 'view_state_item_type': 1, 'ranking_weight': 0.0, 'enable_feed_waist_in_menu': False, 'enable_waist': False, 'waist_data': ''}

@tajbowness tajbowness added the bug Something isn't working label Mar 11, 2024
@tajbowness
Copy link
Contributor Author

Possible Solution
Removing the ", _" from "media_pk, _ = media_id.split("") " solves the issue.

*Github hides the underscore

@tajbowness
Copy link
Contributor Author

For this particular post it had two underscores in the post id 'id': '3307278577288067651_63510424646_mccr40091ae1'

It traditionally only has one underscore. This was a post from the timeline timeline_posts = cl.get_timeline_feed()

Values from posts from the timeline must have a different format because the result of cl.media_info(post["pk"]) gives an id with only one underscore.

Solution:
To get the posts proper or acceptable id, use post_pk = cl.media_info(post["pk"]) then do cl.media_like(post_pk) to not get the ValueError exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant