Archives YouTube community posts.
Project description
yt-community-post-archiver
Archives YouTube community posts. Will try and grab the post's text content, images at as large of a resolution as possible, polls, and some other various bits of metadata. Works on members posts too if you're logged in/using cookies.
Note that:
- This was originally written very quickly to archive things in time for something, so it is somewhat scuffed.
- The scraping is also done in a way which is somewhat fragile, and may break easily as YouTube updates things.
Feel free to report problems or suggest features, though as a disclaimer, I may not have the bandwidth or interest to tackle all reported issues. PRs are always welcome, though!
Installation/Usage
From PyPI
The script is available via pypi:
-
Install via
pip(or alternatives likepipx):pip install yt-community-post-archiver
-
Run
yt-community-post-archiver. For example:yt-community-post-archiver "https://www.youtube.com/@PomuRainpuff/posts"
This will spawn a headless Chrome instance (that is, you won't see a Chrome window) and download all posts it can find from the provided page, and save text metadata + images in an automatically created folder called
archive-outputin the same directory the program was called in. Note this will take a while!For info on the options you can use, run with
--help:yt-community-post-archiver --help
From the wheel
From Releases, you can install a wheel for this using Python.
-
Download one of the
.whlfiles from Releases -
Install the wheel file. For example, if the file you downloaded is called
yt_community_post_archiver-0.1.0-py3-none-any.whl:pip install yt_community_post_archiver-0.1.0-py3-none-any.whl
-
Run
yt-community-post-archiver. For example:yt-community-post-archiver "https://www.youtube.com/@PomuRainpuff/posts"
This will spawn a headless Chrome instance (that is, you won't see a Chrome window) and download all posts it can find from the provided page, and save text metadata + images in an automatically created folder called
archive-outputin the same directory the program was called in. Note this will take a while!For info on the options you can use, run with
--help:yt-community-post-archiver --help
From the repo
-
Clone the repo.
-
(Optional) Create and source a venv:
python3 -m venv venv source venv/bin/activate
-
(Optional) Install
uvif you do not already have it:pip3 install uv
-
Make sure the computer you're running this on has Chrome or Firefox, as it uses a browser to grab posts.
-
Run the archiver using
uv run yt-community-post-archiver. For example:uv run yt-community-post-archiver "https://www.youtube.com/@PomuRainpuff/posts"
This will spawn a headless Chrome instance (that is, you won't see a Chrome window) and download all posts it can find from the provided page, and save text metadata + images in an automatically created folder called
archive-outputin the same directory the program was called in. Note this will take a while!For info on the options you can use, run with
--help:yt-community-post-archiver --help
Examples
For example, let's say I run:
yt-community-post-archiver "https://www.youtube.com/@IRyS/posts" -o "output/testing" -m 1
This runs the archiver, directed to https://www.youtube.com/@IRyS/posts, saving to output/testing, and gets
a maximum of one post. If you are running from the repo, then replace yt-community-post-archiver with
uv run yt-community-post-archiver.
At the time of writing, this gives me two files that look like this - post.json:
{
"url": "https://www.youtube.com/post/UgkxzjFK9MbmdHoUW7Tyg54ncKqzkQxAb1AN",
"text": "😈💎NEW ORIGINAL SONG MV RELEASE💎👼\n\n\r\nTwiLight has just dropped on the internet and it is LOUD with a fantastically spicy MV to boot!! \n\n\r\nThe song will also be releasing on streaming platforms at midnight JST/3PM GMT/7AM PST!\r\nhttps://cover.lnk.to/mrc6zl\n\n\r\nComposer and Arrangement:\r 雄之助\nLyrics\r: 牛肉\nMV\r: Kanauru\nLogo Design\r: saku㊴ \nChoreography\r: まりやん",
"images": [
"https://i.ytimg.com/vi/dFZ1oTSFuIE/hq720.jpg?sqp=-oaymwEnCOgCEMoBSFryq4qpAxkIARUAAIhCGAHYAQHiAQoIGBACGAY4AUAB&rs=AOn4CLBEYbFyLyBzcYH2qy6j4jcoSEw4Uw=s0?imgmax=0"
],
"links": [
"https://www.youtube.com/post/UgkxzjFK9MbmdHoUW7Tyg54ncKqzkQxAb1AN",
"https://cover.lnk.to/mrc6zl",
"https://www.youtube.com/watch?v=dFZ1oTSFuIE",
"https://www.youtube.com/channel/UC8rcEBzJSleTkf_-agPM20g"
],
"is_members": false,
"relative_date": "1 year ago (edited)",
"approximate_num_comments": "35",
"num_comments": "35",
"num_thumbs_up": "1.6K",
"poll": null,
"when_archived": "2026-03-24 04:12:16.851436+00:00"
}
and an image file called UgkxzjFK9MbmdHoUW7Tyg54ncKqzkQxAb1AN-0.jpg, containing the included image. Note that some
details may change throughout the versions; this document will be updated to reflect that though.
Set save location
If you want to set the save location, then use -o:
yt-community-post-archiver "https://www.youtube.com/@IRyS/posts" -o "/home/me/my_save"
Logging in
You may want to provide a logged-in instance to this tool as this is the only way to get membership posts or certain details like poll vote percentages. The tool supports a few methods.
Using a browser profile
I've found this way works a bit better from personal experience. You can re-use an existing browser profile that is
logged into your YouTube account to grab membership posts with the -p flag, where the path is where your user
profiles are located (for example, in Chrome, you can find this with chrome://version). For example:
yt-community-post-archiver -o output/ -p ~/.config/chromium/ "https://www.youtube.com/@WatsonAmelia/membership"
By default this will use the default profile name; if you need to override this then use -n as well. I highly recommend
creating a new profile for using this tool (whether it's Chrome or Firefox) just so it doesn't accidentally delete some tabs or something.
Using a cookies file
Another method is if you have a Netscape-format cookies file, which you can pass the path with -c / --cookies:
yt-community-post-archiver "https://www.youtube.com/@WatsonAmelia/posts" -c "/home/me/my_cookies_file.txt"
You can see how to get a cookies file by following the instructions on how to do so from yt-dlp.
Note that from personal experience, this sometimes breaks, so your mileage may vary.
Also note that when using this from WSL, avoid reusing a Windows Chrome profile path (/mnt/c/.../User Data) with -p. Linux Chrome/Chromium in WSL does not reliably read/decrypt Windows profile data. Use a Linux profile directory
instead (for example ~/.config/google-chrome) or use a cookie file.
Using remote debugging to connect to a running instance
You can also start Chrome/Chromium with a remote debugging port, and connect this program to it. For example:
-
Start up Chrome/Chromium with a remote debugging port:
chromium --remote-debugging-port=9222 --profile-directory="Profile 1"
-
Start
yt-community-post-archiver:yt-community-post-archiver "https://www.youtube.com/@kaminariclara/posts" -o "output" --remote-debugging-port 9222
Use Firefox instead of Chrome as the driver
The default driver is Chrome, but Firefox should work as well.
yt-community-post-archiver "https://www.youtube.com/@PomuRainpuff/posts" -d "firefox"
Other Information
Polls
Poll vote percentages can only be shown if you are logged in, due to how vote results are only shown if the user has voted before.
This also means that if you are logged in but have not voted on the poll before in a post, the tool will temporarily vote for you so it can see the vote percentages. It will try to remove the vote if it had to do this to avoid affecting anything, though be aware that this may sometimes fail!
How does this work?
This is just a typical Selenium/BeautifulSoup program, that's it. As such, it's simulating being a user and manually copying + formatting all the data via a browser window. This is very evident if you disable headless mode, and see all the action.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yt_community_post_archiver-0.2.0.tar.gz.
File metadata
- Download URL: yt_community_post_archiver-0.2.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7168e69253d2736c55aa8c50867906e2812b98686fc2d355404e8bfca1d218e2
|
|
| MD5 |
74fa19de0cfe2c4b614b774a18e84e4a
|
|
| BLAKE2b-256 |
d6b1eca1d45f8a2083f330626846a3d7b149df42865c81c5dda572a0c1b5ee76
|
Provenance
The following attestation bundles were made for yt_community_post_archiver-0.2.0.tar.gz:
Publisher:
build.yml on Pyreko/yt-community-post-archiver
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yt_community_post_archiver-0.2.0.tar.gz -
Subject digest:
7168e69253d2736c55aa8c50867906e2812b98686fc2d355404e8bfca1d218e2 - Sigstore transparency entry: 1170299769
- Sigstore integration time:
-
Permalink:
Pyreko/yt-community-post-archiver@f6a4cd9bc558bd104f086613e8e5971c6c357e1a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Pyreko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@f6a4cd9bc558bd104f086613e8e5971c6c357e1a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file yt_community_post_archiver-0.2.0-py3-none-any.whl.
File metadata
- Download URL: yt_community_post_archiver-0.2.0-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
806bcb9d1c454df4ab221e6ad9eeabef309f5fa5830259d4bf058041aca6020b
|
|
| MD5 |
7874215a54d8e189c9c04cc9990c65c0
|
|
| BLAKE2b-256 |
abee71186b91f4fead6ee15a6b24b2df1391858fc70b7388761621e3e56ae13e
|
Provenance
The following attestation bundles were made for yt_community_post_archiver-0.2.0-py3-none-any.whl:
Publisher:
build.yml on Pyreko/yt-community-post-archiver
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yt_community_post_archiver-0.2.0-py3-none-any.whl -
Subject digest:
806bcb9d1c454df4ab221e6ad9eeabef309f5fa5830259d4bf058041aca6020b - Sigstore transparency entry: 1170299835
- Sigstore integration time:
-
Permalink:
Pyreko/yt-community-post-archiver@f6a4cd9bc558bd104f086613e8e5971c6c357e1a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Pyreko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@f6a4cd9bc558bd104f086613e8e5971c6c357e1a -
Trigger Event:
workflow_dispatch
-
Statement type: