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

[Instagram] Extract comments #10788

Merged
merged 1 commit into from
Sep 29, 2016
Merged

Conversation

TRox1972
Copy link
Contributor

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

This adds support for comments extraction for Instagram

@@ -0,0 +1 @@
{"http_headers": {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/47.0 (Chrome)", "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language": "en-us,en;q=0.5", "Accept-Encoding": "gzip, deflate"}, "playlist_index": null, "webpage_url_basename": "BKhrorNBKyV", "description": "@kingsofleon with my favourite people \ud83d\udcf9\ud83d\udca5\ud83d\udc99\ud83d\udc99\ud83d\udc99@dimitribasil @laura_go_run @soopercooper_", "format_id": "0", "extractor": "Instagram", "comment_count": 26, "display_id": "BKhrorNBKyV", "format": "0 - unknown", "_filename": "Video by carolinemonteithwilson-BKhrorNBKyV.mp4", "webpage_url": "https://www.instagram.com/p/BKhrorNBKyV/?taken-by=carolinemonteithwilson", "id": "BKhrorNBKyV", "title": "Video by carolinemonteithwilson", "thumbnails": [{"url": "https://scontent-amt2-1.cdninstagram.com/t51.2885-15/s1080x1080/e15/fr/14280457_305399146494488_2085348421_n.jpg?ig_cache_key=MTM0MjU0NjA3NTEwMTQ3Mzk0MQ%3D%3D.2", "id": "0"}], "uploader_id": "carolinemonteithwilson", "protocol": "https", "timestamp": 1474263985, "extractor_key": "Instagram", "ext": "mp4", "upload_date": "20160919", "thumbnail": "https://scontent-amt2-1.cdninstagram.com/t51.2885-15/s1080x1080/e15/fr/14280457_305399146494488_2085348421_n.jpg?ig_cache_key=MTM0MjU0NjA3NTEwMTQ3Mzk0MQ%3D%3D.2", "url": "https://scontent-amt2-1.cdninstagram.com/t50.2886-16/14406433_1764201343843456_1242211862_n.mp4", "uploader": "carolinemonteithwilson", "playlist": null, "fulltitle": "Video by carolinemonteithwilson", "like_count": 216}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidentally commited?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. fixed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

'id': comment.get('id'),
'text': comment.get('text'),
'timestamp': int_or_none(comment.get('created_at')),
} for comment in media.get('comments', {}).get('nodes', {})]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a _TEST.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated previous test cases. Is that ok?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks.

@TRox1972 TRox1972 force-pushed the instagram_comments branch 3 times, most recently from a8eb6f5 to bfb08ac Compare September 28, 2016 15:12
'author': comment.get('user', {}).get('username'),
'author_id': comment.get('user', {}).get('id'),
'id': comment.get('id'),
'text': comment.get('text'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either text or html is mandatory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@yan12125 yan12125 merged commit 0ce26ef into ytdl-org:master Sep 29, 2016
@yan12125
Copy link
Collaborator

Merged thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants