ガイド ツール (更新)gallery-dlでのダウンロードガイド

NikoCast6

ROM専
登録日
2024年12月25日
投稿
107
リアクションスコア
1
Originally posted in this thread where few would ever see it. I thought I'd post an update in my profile, but there's a pretty short length limit on profile posts. So here let me welcome you to my:

:HACKERMANS: _______GUIDE TO GALLERY-DL______ :HACKERMANS:
[ free + open source ]

Q: why tf should I use gallery-dl?A:it magically downloads photo albums - social media - file hosts - image hosts

Q: what sites can it download from?A:instagram + twitter + tiktok + reddit + pinterest + imagefap + redgifs + goonbox

Q: is that all?A: fuck no. it also downloads from:bunkr + gofile + pixeldrain + turbo + tube sites + a shitload more

:HACKERMANS: WHAT YOU NEED TO KNOW: :HACKERMANS:




  • The answer to whatever you want to know is on the codeberg page: https://codeberg.org/mikf/gallery-dl
    • this includes supported sites, errors (see Issues), how to install, etc.
    • this was formerly on github (https://github.com/mikf/gallery-dl), which can still be helpful for past issues/discussions
  • Benefits of downloading with gallery-dl
    • it simplifies downloading from any site it supports
    • supported sites include instagram, twitter, tiktok, reddit, imagefap, redgifs, cxxmer/kemono, pictoa, pinterest, goonbox, bunkr, gofile, pixeldrain, turbo, many tube sites, many image hosts, and a ton more
    • it makes downloading photo albums painless (especially for sites not equipped to handle image dumps. read: bunkr!)
    • it maintains a database of completed downloads so you don't unwittingly re-dl files you already saved. This also means you can return to that [instagram/reddit/whatever] profile from time to time and it will dl only the new files since last time
  • It's really fucking easy to use
    • basic usage:
      • to download a bunkr album,
        コード:
        gallery-dl https://bunkr.cr/a/RE4jsE8Q
        <- test album. try it out!
      • to download a single file from bunkr,
        コード:
        gallery-dl https://bunkr.cr/f/zGPPQCux9yOYf
      • to download all posts from an instagram profile,
        コード:
        gallery-dl https://www.instagram.com/rachelrileyrr
      • to download tagged posts,
        コード:
        gallery-dl https://www.instagram.com/rachelrileyrr/tagged
        • or replace 'tagged' with 'reels', 'stories', etc. makes sense?
        • alternatively, use
          コード:
          gallery-dl -o include=posts,tagged,reels https://www.instagram.com/rachelrileyrr
    • it's also massively configurable via config file once you learn the ropes (e.g. automatically name files however you want! organize download locations however you want! damn it's so good!)
  • You should install gallery-dl (and any command line tools) using a package manager
    • a package manager keeps all your command line software up to date, including its dependencies, and organizes them all on your system where they can find each other
      • if you're new to the command line, making sure you have needed dependencies, keeping them properly updated, and figuring out how to make the (god damn!) things find each other is the vast majority of headaches you suffer to get any (god. damned.) program working
      • these problems become moot when you use a package manager
      • srsly, especially if you're new to this, don't fuck around with downloading binaries yourself, let the package manager do it for you. And don't come bitching when you can't get it to work because you ignored this advice
    • mac: gallery-dl is available through Homebrew (most popular) & macports
      • macports has better compatibility with more systems, as Homebrew limits support to newer devices/OSes
      • example usage - it is easy:
        • コード:
          sudo port install gallery-dl
          installs the program and its required dependencies
        • コード:
          sudo port selfupdate
          keeps macports up to date and downloads latest info about available programs
        • コード:
          sudo port upgrade outdated
          upgrades all your installed programs to the latest versions
    • windows: supported pkg managers for windows are Chocolatey and Scoop. idk I don't use windows, but same concept
    • linux: linux users already know what package manager they use. shut up
    • super mega bonus tip: if everything is working and you feel comfortable, you can begin updating on your own to the nightly (aka development) version. it can take a few days or more for additions and bug fixes to make it to a release, but you're guaranteed the latest when you install the nightly. follow the directions under "Install the latest dev version directly from master" -> https://codeberg.org/mikf/gallery-dl#pip <-
  • If something used to work and now it doesn't, upgrade your software to latest versions
    • stuff breaks all the time. websites make a small change that breaks tools and developers need to make changes to keep everything pointed in the right direction. this is how stuff works
    • even if you just upgraded yesterday, check again today. devs of popular software release new versions frequently
    • if you want fixes before they're even released, check the super mega bonus tip above
  • If something is not working, look to the codeberg issues page
    • i'll even link to it for you: https://codeberg.org/mikf/gallery-dl/issues
    • don't ask about the latest bug here or anywhere else other than the gallery-dl repo - nobody knows or cares. ask about it at the link i gave 1 line above this (search for it first because somebody has probably brought it up already)
    • new bugs and stuff will be in "Open" issues. everything anyone's ever asked about will be in "Closed" issues. make sure you are checking both
  • Go forth and download
    • if you're new to the command line, remember that "new" is not the same as "hard". at one time you didn't know how to pick your nose
    • コード:
      Ctrl+C
      exits you out of running programs
    • remember to go outside every few days, now that you have this power it can be hard to stop using it

ADDITIONAL Q&A:

Q: are you affiliated with gallery-dl?A:not at all. it's just life-changing software that i've spent a lot of time learning and using, and more people should know about and use it.

Q: now that i'm using gallery-dl, will you also come over and jerk me off?A:if you're reasonably fit, young, and don't have a beard, yeah i'll probably do it.
 
gallery-dl大好きなんだけど、使うとアカウントがロックされて地味にウザい、ボットだと思われてるけど俺はただの効率的な素敵なお宝コレクターなだけなのに :peepoShy:。gallery-dlだけじゃなくて他の似たツールでも試したけど、そっちでもロックされた。この便利なガイドに従う人に警告しておくけど、スクレイパーの道を歩むと、アカウントはあのクソCLANKERSみたいに扱われてBANされるかもしれない :BongoBan:、だから慎重にスクレイプしろよ!!
 
心配してる人向けに、この投稿で1行だけ読むならこれ:これはよくあることじゃないし、避けられるし、わざとアカウントにログインしなければそもそも起こりえない。

大量のコンテンツをスクレイピングしてる人は気をつけて。俺はダウンロードするサイトでほとんどアカウントを使わない。InstagramとTikTokからは定期的に落としてるけど、認証済みクッキーを使ったのはTwitterの年齢制限付き投稿を見る時くらいだと思う。もちろんそれをやってる時は自分で分かるし、先にリポジトリの情報を確認できる。開発者はすごく活発で、エクストラクターも問題が起きないように作られてるけど、ツールを安全に使うために先にドキュメントを読むのは自分たち次第でもある。

何が起きたのか、いつだったのか、どのサイトから落としてたのか簡単に説明してくれると助かる。もちろん起こりうるけど、まれだし、大規模にダウンロードしてなければもっとまれで、認証しなければ不可能。ここでの目的は、どれだけ簡単に起こりうるかを知ってもらうことで、ほぼ起きないことを怖がって人を遠ざけたいわけじゃない。
 
うん、じゃあTwitterのダウンロードで認証済みクッキーを使う話をしよう。ロックアウト/凍結の可能性を減らすには、リポジトリのどこを見て、どのドキュメントを読めばいい?めったにないとはいえ、俺らの中には食らう人もいるんだよね…
 
もちろん、疑ってないよ。ちなみに俺の投稿は挑発じゃなくて、効率とか整理とか頭痛の種をなくすって意味で自分の人生を変えたツールを、怖がって誰にも逃げてほしくないってだけ。

Twitterからそんなに大量には落としてなくて、基本は単発の投稿だけど、アカウントまるごとを1〜2個落としたことはある。それは直近6ヶ月以内で、問題は一切なかった。

最近の動きや過去の不具合を追うなら、gallery-dlのリポジトリのissue trackerが一番。実はcodebergに移ってから2つあって、githubのissue trackerもまだ開いてて動いてるんだよね。githubのリポジトリにはDiscussionsのセクションもあって、一般的な質問はそこでされてる。

基本的な使い方は簡単だけど、コツを掴んだら本当の力は、extractorにどう動くか指示するconfig.jsonを作るところにある。何が使えるか、構文がどう動くかを覚えるまでちょっと学習コストはあるけど、そのうち全部繋がってきてめちゃくちゃ快適になる。オプションの多くは何をダウンロードするか、ファイル名をどうするか、何をどこに置くかについてだけど、サイトとどうやり取りするかをextractorに指示するものも多い。extractorはサイトごとに専用で作られてて独自のオプションがあるから、それを掘ると生活が良くなる/楽になる。

ドキュメントはまさに「docs」って名前のフォルダにある。gallery-dl-example.confは設定ファイルの基本構造を示してる。configuration.rstは化け物みたいなファイルで、使えるオプション全部とその効果が載ってる。本格的にスクレイピングするなら、このファイルにしっかり時間を使うべき。俺も何度も戻ってる。網羅的だけど手順書みたいには書かれてないから、知識を積むのに時間がかかる。でも全体がどう繋がるか分かってくると意味が通ってくる。最後にgallery-dl.confは、全設定とそのデフォルト値を、設定ファイルでそのまま使う形式で並べただけのリスト。新しいオプションやサイトが追加されると更新されるから、常に最新。

いつかここに、例付きで設定ファイルの基本的なハウツーを追加したい。先月、gallery-dlでsimpcityの投稿/スレを落とすスレがあって、そこで投稿して、あれはすぐ手に負えなくなるから「このスレ全部落とす」より具体的な対象を決めた方がいいって説明したんだ。そのスレはフォーラムのスクレイピングを助長したくないってことで結局削除された。もしモデがこれを読んで、俺の投稿をPMで送ってくれるならありがたいし、スレのスクレイピングの手順は全部消して、なぜそれが悪手かの説明だけ残すよ。

他のみんなも、このスレで気軽に質問して。学んだことは喜んで共有するよ。
 
gallery dlは今年の初めに使い始めてから本当に神ツールだった。

ちょうど先週、tiktokとinstagramのストーリーを自動でダウンロードするやつを組もうと調べてて、instagramにはgallery dl、tiktokにはyt dlpを使うgit projectを見つけた。かなりいじった結果、やっとtiktokのストーリーと投稿を自動で監視して、自動ダウンロードもしつつ、一定時間後にもっと高画質な版に差し替えるチェックもできるようになった。tiktokは特に投稿直後だと常に最高解像度とは限らないからね。

tiktokのライブの自動録画とダウンロードもまだ追加しないといけないし、そのあとinstagram側も同じ構成で主にストーリーを自動で保存できるようにするつもりだけど、今のところかなりいい感じ。

スレ違いだったらごめん、でもgallery dlのスレだから、これを使った選択肢を探してる人の参考になるかなと思って。
 
残念ながらどれもうまくいってない。:Sadge:

下のやつ全部VPN使って試したけど、Instaloaderは即429になる。使ってるプロフィールAPIのエンドポイントが非推奨になってるってissueを見かけたし、修正のプルリクを出してる人もいるから、マージされたらまた試すかも。

ネットのチュートリアルだとまずgallery-dlをsimulateオプションで試せって書いてあるけど、プロフィールが見つからないって出る。issueには、NSFWアカウントは公開でもログインしないと抜けないっぽいって書いてあった。

gallery-dl用とかGramoireみたいなやつ用に新規アカウント作ろうとしたけど、IGがProtonmailのメアドをシャドウブロックしてるみたいで認証コードを受け付けてくれない。10分メールでもう一回やったらコードは通ったけど、今度は電話番号を求められた。本アカでやる気はないし、捨てアカを本アカに紐付けられるリスクも避けたい。

---

みんなはツールにログインもクッキー渡しもせずにIGの投稿ダウンロードできてる?それともログインして本アカのリスク背負ってる?もしくは捨てアカ作れてるの?抜きたいメインのアカウントは非公開じゃないから、ログインなしでなんとかできないかなと思ってた。
 
igの機能は作者がアップデートするまで死んでるし、たぶんしばらく更新されないと思う
 
戻る
トップ