subzeroid / instagrapi

🔥 The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.37k stars 684 forks source link

[Error in track_info_by_canonical_id] #1340

Open notsarv opened 1 year ago

notsarv commented 1 year ago

I am trying to get track info from a reel's audio canonical id

The Error i got :

Traceback (most recent call last):
  File "/root/insta-dm-bot-python/b.py", line 39, in <module>
    handle_reel(message);
    ^^^^^^^^^^^^^^^^^^^^
  File "/root/insta-dm-bot-python/b.py", line 20, in handle_reel
    reel_track = client.track_info_by_canonical_id(message.clip.clips_metadata['music_canonical_id'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/instagrapi/mixins/track.py", line 67, in track_info_by_canonical_id
    return extract_track(track)
           ^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/instagrapi/extractors.py", line 435, in extract_track
    data["cover_artwork_uri"] = data.get("cover_artwork_uri") or None
                                ^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

track.py give none as parameter to extractor.py. maybe because change in instagram api. Please give a check ....

adw0rd commented 1 year ago

Show what's in message.clip.clips_metadata['music_canonical_id']