Comments (13)
Glad to hear. I'd like to keep it open until there's a support for an input file and/or config in Monolith, if you don't mind.
from monolith.
Hello Yuri,
that sounds like a good idea! I believe it can be achieved by using cat
and some other methods, described here: https://www.baeldung.com/linux/file-line-command-argument
Please let me know if it works.
from monolith.
I came here to see if this feature was suggested by anyone. Great idea!
from monolith.
@snshn yeah, that most likely would work.
What I'd love to have is not to have to do it at all.
I'd rather just run monolith https://lyrics.github.io/db/P/Portishead/Dummy/Roads/ -o portishead-roads-lyrics.html
and automatically apply the blacklist from the file (that for example is in the same dir as monolith with default name blacklist.txt
). I now reread the initial comment and I see I didn't mention that.
I am not an avid shell user so I spent around 15 min to try to come up with an actual example how cat would work and I couldn't 🙈. I guess it would save some time for people like me to be able to just run monolith -B blacklist_permissive.txt https://lyrics.github.io/db/P/Portishead/Dummy/Roads/ -o portishead-roads-lyrics.html
.
from monolith.
Maybe the contents of blacklist_permissive.txt
can be fed to the -B
options?
I can't guarantee, but for example, ls -a -l
and ls $(options.txt)
ls $(cat options.txt)
look identical, assuming options.txt
is as below.
options.txt
-a
-l
If you have a list of domains to block, can you try and tell me if this works?
Your command should look something like monolith -I -B -d $(blacklists.txt)
monolith -I -B -d $(cat blacklists.txt)
.
(I updated my comment to fix a mistake)
from monolith.
@htcrefactor which terminal emulator do you use? I tried echo $(blacklist.txt)
in zsh and bash on MacOS but I get zsh/bash: command not found: blacklist.txt
from monolith.
I've tested it on the default terminal emulator for Ubuntu 22.04 (Jammy), but I need to figure out what it is. I'll make sure to get back to you with more information later.
from monolith.
@htcrefactor not urgent or important. Please take your time and thanks for looking into it.
from monolith.
Maybe monolith -I -B -d $(cat blacklists.txt)
may work for you? This also looks more correct and compliant.
I found a relevant concept called command substitution in GNU's bash
manual. According to the manual, ls -a -l
, ls $(cat options.txt)
, and ls $(< options.txt)
are all equal commands (when the previous assumption on options.txt
are held valid).
I've tested it on Git Bash
via Microsoft Terminal on Windows 11. Have a look at the below screenshot.
from monolith.
I fixed my previous comment(quoted below) because it was incorrect.
Maybe the contents of
blacklist_permissive.txt
can be fed to the-B
options?I can't guarantee, but for example,
ls -a -l
andls $(options.txt)
ls $(cat options.txt)
look identical, assumingoptions.txt
is as below.If you have a list of domains to block, can you try and tell me if this works? Your command should look something like
monolith -I -B -d $(blacklists.txt)
monolith -I -B -d $(cat blacklists.txt)
.
from monolith.
@htcrefactor
this is what I tried but it doesn't seem to work
monolith -I -B -d $(cat blacklist.txt) -o humans-are-not-automatically-strategic.html https://www.lesswrong.com/posts/PBRWb2Em5SNeWYwwB/humans-are-not-automatically-strategic
error: Found argument 'https://www.lesswrong.com/posts/PBRWb2Em5SNeWYwwB/humans-are-not-automatically-strategic' which wasn't expected, or isn't valid in this context
USAGE:
monolith [OPTIONS] <target>
For more information try --help
Same for: monolith -I -B -d $(cat blacklist.txt) https://www.lesswrong.com/posts/PBRWb2Em5SNeWYwwB/humans-are-not-automatically-strategic -o humans-are-not-automatically-strategic.html
error: Found argument 'https://www.lesswrong.com/posts/PBRWb2Em5SNeWYwwB/humans-are-not-automatically-strategic' which wasn't expected, or isn't valid in this context
USAGE:
monolith [OPTIONS] <target>
For more information try --help
from monolith.
It looks like you might need to place -d
prior to every line extracted from blacklist.txt...
Possibly xargs
could be used as described here https://unix.stackexchange.com/questions/393351/pass-contents-of-file-as-argument-to-bash-script but I think it may be way simpler than that.
Something like this:
echo $(awk 'NF {print "-d " $0}' blacklist.txt)
This seems to be working:
monolith -I -B $(awk 'NF {print "-d " $0}' blacklist.txt) https://www.lesswrong.com/posts/PBRWb2Em5SNeWYwwB/humans-are-not-automatically-strategic -o humans-are-not-automatically-strategic.html
from monolith.
@snshn Yep, that worked. Thanks for looking into it.
I guess if we leave this for posterity the feature request can be closed 🤷♂️
from monolith.
Related Issues (20)
- Outdated Project Reference in README HOT 2
- The page you need to log in cannot be saved after logging in HOT 1
- whole progress failed caused by get favicon.ico HOT 1
- Unicode mangling
- [Bug] Data URLs exceed length limits HOT 8
- Incomplete output on broken HTML like https://distrowatch.com/table.php?distribution=void HOT 5
- Save apple-touch-icon too HOT 3
- "https://mp.weixin.qq.com" web title and CSS switch image on click not work
- How to get just HTML, no <script> HOT 1
- Additionally fetch dynamic content HOT 3
- [proposal] An option to remove alternative sources for media urls HOT 1
- HTML page content partially invisible HOT 2
- Site doesnt work HOT 1
- download path ? HOT 1
- Site doesn't work, redirected towards ct.captcha-delivery.com HOT 1
- What's the default location sites are being saved to? HOT 3
- Relax glibc version requirement HOT 3
- Aggregate multiple html files? HOT 3
- Saving all files separately like IDM. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monolith.