OlegYurchik / pyInstagram

This is a simple and easy-to-use library for interacting with the Instagram. The library works through the web interface of the Instagram and does not depend on the official API
MIT License
232 stars 49 forks source link

Album #59

Open PetrKlassen opened 5 years ago

PetrKlassen commented 5 years ago

Media.album всегда содержит пустой set. Если это может быть важно: аккаунт скрытый.

agent = Agent(...)
account = Account(...)

agent.get_media(account, count=1)
count = account.media_count
all_media = agent.get_media(account, count=120)
  for row_media in all_media[0]:
    media = Media(row_media)
    print(media.display_url)
    if media.is_album:
      print(len(media.album)) # 0
PetrKlassen commented 5 years ago

Судя по всему, не работает этот момент:

if edge["node"].get("shortcode", self.code) != self.code:
  self.album.add(Media(edge["node"]["shortcode"]))

т.к. я получаю, внутри edge_sidecar_to_children:

"node": {
  "accessibility_caption": null,
  "dimensions": {"height": 1080, "width": 1080},
  "display_resources": "(3) [{…}, {…}, {…}]",
  "display_url": "...",
  "edge_media_to_tagged_user": {"edges": "Array(0)"},
  "id": "...",
  "is_video": false,
  "should_log_client_event": false,
  "tracking_token": "...",
}

И тут нет ни какого "shortcode".

issim91 commented 5 years ago

+1 к проблеме Только у меня даже условие if "edge_sidecar_to_children" in data: не срабатывает