mirror of
https://github.com/nadimkobeissi/mkbsd.git
synced 2025-04-18 17:46:32 -04:00
Merge 9d0ba1c580
into 82e50c64f0
This commit is contained in:
commit
410a353014
2 changed files with 54 additions and 77 deletions
67
README.md
67
README.md
|
@ -1,67 +0,0 @@
|
|||
```
|
||||
/$$ /$$ /$$ /$$ /$$$$$$$ /$$$$$$ /$$$$$$$
|
||||
| $$$ /$$$| $$ /$$/| $$__ $$ /$$__ $$| $$__ $$
|
||||
| $$$$ /$$$$| $$ /$$/ | $$ \ $$| $$ \__/| $$ \ $$
|
||||
| $$ $$/$$ $$| $$$$$/ | $$$$$$$ | $$$$$$ | $$ | $$
|
||||
| $$ $$$| $$| $$ $$ | $$__ $$ \____ $$| $$ | $$
|
||||
| $$\ $ | $$| $$\ $$ | $$ \ $$ /$$ \ $$| $$ | $$
|
||||
| $$ \/ | $$| $$ \ $$| $$$$$$$/| $$$$$$/| $$$$$$$/
|
||||
|__/ |__/|__/ \__/|_______/ \______/ |_______/
|
||||
```
|
||||
|
||||
_Because selling out is bad_
|
||||
|
||||
## How to use
|
||||
|
||||
MKBSD comes in two variants! Node.js and Python.
|
||||
|
||||
### Running in Node.js
|
||||
|
||||
1. Ensure you have Node.js installed.
|
||||
2. Run `node mkbsd.js`
|
||||
3. Wait a little.
|
||||
4. All wallpapers are now in a newly created `downloads` subfolder.
|
||||
|
||||
### Running in Python
|
||||
|
||||
1. Ensure you have Python installed.
|
||||
2. Ensure you have the `aiohttp` Python package installed (`pip install aiohttp`).
|
||||
3. Run `python mkbsd.py`
|
||||
4. Wait a little.
|
||||
5. All wallpapers are now in a newly created `downloads` subfolder.
|
||||
|
||||
## FAQ
|
||||
|
||||
### Q: What's the story behind this?
|
||||
|
||||
On September 24th, 2024, well-known tech YouTuber MKBHD released Panels, a wallpaper app that:
|
||||
|
||||
- Had insanely invasive, unjustified tracking including for location history and search history.
|
||||
- Charged artists a predatory 50% commission (even Apple takes only 30% for app purchases).
|
||||
- Forced you to watch two ads for every wallpaper that you wanted to download, and then only letting you download it in SD.
|
||||
- Gatekept all HD wallpapers behind a **fifty dollars a year subscription**.
|
||||
- Had many wallpapers that were essentially AI-generated slop or badly edited stock photos.
|
||||
|
||||
Especially given MKBHD's previous criticism of substandard companies and products, people justifiably got upset given that this looked like a pretty blatant grift and cash-grab that is exploitative of the fan base that's trusted his editorial integrity over the past fifteen years. However, on the same day, MKBHD wrote a post doubling down on the app.
|
||||
|
||||
### Q: Aren't you stealing from artists by running this script?
|
||||
|
||||
MKBSD accesses publicly available media through the Panels app's own API. It doesn't do anything shady or illegal. The real problem here is Panels and MKBHD's complete inability to provide a secure platform for the artists that they're ~~exploiting~~ working with. Any other app could have avoided the issues that make MKBSD possible had it been engineered competently.
|
||||
|
||||
## License
|
||||
|
||||
```
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
```
|
64
mkbsd.js
64
mkbsd.js
|
@ -1,14 +1,13 @@
|
|||
// Copyright 2024 Nadim Kobeissi
|
||||
// Licensed under the WTFPL License
|
||||
|
||||
|
||||
const fs = require(`fs`);
|
||||
const path = require(`path`);
|
||||
const readline = require('readline');
|
||||
|
||||
async function main() {
|
||||
async function main(imageCount) {
|
||||
const url = 'https://storage.googleapis.com/panels-api/data/20240916/media-1a-i-p~s';
|
||||
const delay = (ms) => {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
|
@ -19,13 +18,24 @@ async function main() {
|
|||
if (!data) {
|
||||
throw new Error('⛔ JSON does not have a "data" property at its root.');
|
||||
}
|
||||
|
||||
const totalFiles = Object.keys(data).length; // Count total available files
|
||||
console.info(`📦 Total available files: ${totalFiles}`);
|
||||
|
||||
if (imageCount > totalFiles) {
|
||||
console.warn(`⚠️ You requested ${imageCount} files, but only ${totalFiles} are available. Downloading all available files instead.`);
|
||||
imageCount = totalFiles; // Limit to available files
|
||||
}
|
||||
|
||||
const downloadDir = path.join(__dirname, 'downloads');
|
||||
if (!fs.existsSync(downloadDir)) {
|
||||
fs.mkdirSync(downloadDir);
|
||||
console.info(`📁 Created directory: ${downloadDir}`);
|
||||
}
|
||||
|
||||
let fileIndex = 1;
|
||||
for (const key in data) {
|
||||
if (fileIndex > imageCount) break; // Stop if we've reached the desired count
|
||||
const subproperty = data[key];
|
||||
if (subproperty && subproperty.dhd) {
|
||||
const imageUrl = subproperty.dhd;
|
||||
|
@ -69,7 +79,41 @@ function asciiArt() {
|
|||
console.info(`🤑 Starting downloads from your favorite sellout grifter's wallpaper app...`);
|
||||
}
|
||||
|
||||
(() => {
|
||||
asciiArt();
|
||||
setTimeout(main, 5000);
|
||||
})();
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
});
|
||||
|
||||
// Function to start the download process
|
||||
async function startDownload() {
|
||||
const url = 'https://storage.googleapis.com/panels-api/data/20240916/media-1a-i-p~s';
|
||||
const response = await fetch(url);
|
||||
const jsonData = await response.json();
|
||||
const data = jsonData.data;
|
||||
|
||||
const totalFiles = Object.keys(data).length; // Count total available files
|
||||
console.info(`📦 Total available files: ${totalFiles}`);
|
||||
|
||||
rl.question('How many images would you like to download? ', (answer) => {
|
||||
let imageCount = parseInt(answer, 10);
|
||||
if (isNaN(imageCount) || imageCount <= 0) {
|
||||
console.error('Please enter a valid positive number.');
|
||||
rl.close();
|
||||
return;
|
||||
}
|
||||
|
||||
if (imageCount > totalFiles) {
|
||||
console.warn(`⚠️ You requested ${imageCount} files, but only ${totalFiles} are available. Downloading all available files instead.`);
|
||||
imageCount = totalFiles; // Limit to available files
|
||||
}
|
||||
|
||||
asciiArt();
|
||||
setTimeout(() => {
|
||||
main(imageCount).finally(() => rl.close());
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
|
||||
// Start the download process
|
||||
startDownload();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue