-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from lazmond3/souji
clean up
- Loading branch information
Showing
5 changed files
with
45 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,39 @@ | ||
# ダンプ | ||
https://www.instagram.com/p/CQdnVrkHZOC/?utm_source=ig_web_copy_link&__a=1 こちらのファイルを, instagram_multi_img.json こちらに | ||
# 使い方 (how to use) | ||
|
||
複数画像は、 | ||
``` | ||
edge_sidecar_to_children.edges[].node.display_url | ||
```bash | ||
# DEPENDS ON... | ||
# - dict2obj (easier to access json object) | ||
# - discord.py (bot) | ||
# - requests (access to instagram) | ||
# - boto3 (upload images and videos to s3) | ||
# - youtube_dl (download youtube, tiktok) | ||
# - ffmpeg (truncate video to sizing limitation for attachment) | ||
# - black (format) | ||
# - flake8 (linter) | ||
# - autopep8 (linter) | ||
# - isort (format) | ||
# - beautifulsoup4 (parse html; for ask.fm) | ||
# - pytest... (unit test) | ||
# - elasticsearch, CMRESHandler (logging to elasticsearch) | ||
pip3 -r requirements.txt | ||
|
||
# WHEN RUN ON LOCAL(log output to stdout, else to elasticsearch) | ||
IS_DEBUG=1 ENV=local TOKEN=$TOKEN python3 -m instagram_to_discord | ||
``` | ||
あたりにあるっぽい. | ||
|
||
# TODO | ||
- [ ] env を一括でexport するようにする | ||
- [ ] 後続で画像idxを指定するとき、s3を利用できていない。 | ||
- [ ] terraform のモジュールを検討する。 | ||
- [ ] テスト追加 | ||
- [ ] elasticsearch 導入 | ||
- [ ] 結合でsamplesを動かす | ||
- [ ] ファイル名とか、パス名とか、一元管理する。 | ||
- [ ] サーバごとの差異を吸収する? | ||
## 動作する機能 FUNCTIONS | ||
- twitter の URL を post したあとに、自動でS3にアーカイブした動画URLを投稿する。(NSFWでない限り、自動でプレビューされる) | ||
- twitter の URL を post したあとに、数字を post すると、当該インデックスの画像を投稿する(スマホで閲覧すると、プレビュー画像は1枚目しか表示されないため、他の画像への言及であることを強調したいときに使う) | ||
|
||
# Usage | ||
>- After posting a twitter URL, post the video URL archived to S3. (Unless it's NSFW, it will be previewed automatically by discord app) | ||
>- If you post a number/numbers(index, comma seperated) after posting a twitter URL, the image(s) those index(indices) indicates will be posted. (When you view discord on a smartphone, only the first preview image is displayed, so use this when you want to emphasize that it is a reference to other images.) | ||
```bash | ||
|
||
pip3 -r requirements.txt | ||
## DEPRECATED: important JSON paths | ||
この項目は、instagram API の `__a=1` が廃止されたため、古くなりました。 | ||
|
||
> This item is obsolete due to the deprecation of __a=1 in the instagram API. | ||
- `edge_sidecar_to_children.edges[].node.display_url` | ||
- `edge_sidecar_to_children.edges[].node.display_url` | ||
|
||
# execution | ||
REDIS_PASS=$REDIS_PASS \ | ||
TOKEN=$DISCORD_BOT_TOKEN \ | ||
DEBUG=1 \ | ||
COOKIE_PATH=cookie2.txt \ | ||
python3 -m instagram_to_discord | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters