No banners, make a banners thread

/cumg/ - - refugee from retarded cuckchan mods. Where technology meets cooming. (NSFW)

New Reply on thread #13
Max 20 files total
[New Reply]

thumbnail of snis-939.cover.jpg
thumbnail of snis-939.cover.jpg
snis-939.c... jpg (186.42 KB, 1055x1500)
Share and discuss cooming-related scripts. This thread is for those who appreciate small-scale programming.  Shell scripts as well as browser userscripts are welcome.

> Wiki

Tips & Tricks:

> Bash Scripting Resources

Bash Hackers Wiki:
Bash Cheat Sheet:
Bash Reference Sheet:
Bash Programming:
Bash Guide:
Advanced Bash Scripting Guide:
Pure Bash Bible:
Official Bash Manual:
Bash Cheat Sheet:

> UserScript Resources

How To Write A UserScript:
echo "Hello, World!"
thumbnail of sspd-152.cover.jpg
thumbnail of sspd-152.cover.jpg
sspd-152.c... jpg (148.7 KB, 1055x1500)
This is one of the simpler versions of the jav script which takes a video code as parameter and streams the video using mpv.  Many derivatives of the original jav shell function were made, but this one is mine.


jav_name() {
  if [ -z "$1" ]; then
    read name
  echo $name

jav_url () {
  name="$(jav_name $1)"
  links="(curl -s "$(curl -s "name/"">$name/" | grep "embedURL" | grep -o "{.*}" | jq '.["@graph"]' | jq -r '.[].embedURL' | sed '/^null$/d' | sed 's/\/v\//\/api\/source\//')" --data-raw 'r=&' | jq -r '.data[] | select(.label | contains("720p", "480p","360p")).file' | tail -n1)"
  echo "$links"

mpv "$(jav_url $1)"


jav sspd-152
The code tag here is no bueno.  It actually corrupted the code by interpreting a $ as a cue to start turning text green, removing the $ in the process.  Let's see what happens if I poste a pastebin URL.
thumbnail of
thumbnail of png (138.16 KB, 1626x755)
I made a userscript for use on endchan /cumg/ to embed pastebins directly on the page like 4chan does.  In the future, maybe we could embed more things beyond pastebin.
> pastebins
unfortunately not ideal because pastebin are fucking cucks. it is preferred to post the code directly on the wiki and just link to that.

Please throw a post to the Endchan admins telling them about this issue.
> it is preferred to post the code directly on the wiki and just link to that.
It's really hard to format code well on the wiki.  The SyntaxHighlight extension (which comes standard with MediaWiki) needs to be enabled at the very least.
Yeah, I've been doing it in quotes for now but obviously not ideal.
I have no way to contact the wiki host so it's a matter of trying to reach out to him.

I've posted on the discussion page about other stuff, but haven't seen a response yet.
sauc for pic related
It's in the file name.  
The wiki admin enabled the   tag.
Where do I get JAV from?
Anyone fixed the script yet?
I'm getting parse errors
Use the script from this pastebin.

endchan isn't good for posting code due to a bug it has as explained in >>/19/ .
Oh wait, it's really not working. changes things up to stop people from downloading.  This could take some time to figure out.
i will write a bash script to download from iwara.
i used iwara-dl from github before, but it's dead. wget should work fine, right?
> wget should work fine, right?
wget should be fine.
thumbnail of 1386775652319.jpg
thumbnail of 1386775652319.jpg
13867756523... jpg (60.73 KB, 434x600)
i am stuck because the download link doesn't appear in the html page that is downloaded using curl/wget. it appears that the download link is generated with js in the browser and i don't know how to go around this. if you have some ideas - please respond
Why re-invent the wheel?
youtube-dl can parse and download from iwara.
If you want to use wget to download then you can use youtube-dl with --get-url flag and pass it to wget.
But if you want to make your own extractor, then you can look up at the extractor and make your own
I'm not sure since I know nothing about python, but it seems to get the video url from iwara API, using JSON.
I think you can parse JSON with jq package.
i remember it not working for me, but it works now, so whatever
thanks for pointing me in the right direction
thumbnail of 7c5b3400e5c7d385828d16a40d3da24feb04bdddfb0678bdc820367f7fa48024.jpg
thumbnail of 7c5b3400e5c7d385828d16a40d3da24feb04bdddfb0678bdc820367f7fa48024.jpg
7c5b3400e5... jpg (2.06 MB, 2480x3508)
What's a good instagram mirror and is there a userscript to redirect instagram profile links to that site?
Here's a Greasemonkey script I wrote that lets you search for a DL Site game on Nyaa in case you're an H game addict like me:
Thanks for the links. p good
thumbnail of 2022-01-14_16-06.m3u8.mitmproxy.png
thumbnail of 2022-01-14_16-06.m3u8.mitmproxy.png
2022-01-14_16-06.m3u8.mitmproxy png (63.69 KB, 1872x41)
Test Subject:

Using mitmproxy,
I was able to find the index.m3u8 file, but I don't know how to figure out the URL for it programatically.

This m3u8 file contains a list of all the parts that can be downloaded and then concatenated together.
The pattern in this case looks like:
all the way to 554.

Alternatively, you can feed the m3u8 URL directly to mpv to stream the video.

Download and Combine m3u8 Stream with ffmpeg

ffmpeg -i -c copy SSPD-150.mp4
> I was able to find the index.m3u8 file, but I don't know how to figure out the URL for it programatically.
The devs at have made it very difficult to inspect the underlying DOM and JS.  
They're using some kind of devtools detector, and 
it's not as easy to disable as it was in this other case:

One heavy-handed approach to finding the index.m3u8 URL could be to use puppeteer to browse to the page and 
click around while setting up some code to monitor network requests.
> mpv

Out of curiosity, I tried:
mpv ">
and it didn't work.
I don't have mitmproxy setup on the laptop I'm currently using, but 
I wonder what the right m3u8 URL is for ADN-219.
My guess is that the "Cen" part will be different, but everything else would follow the same structure.
thumbnail of 1200px-Shishiro_Botan_-_Portrait_01.png
thumbnail of 1200px-Shishiro_Botan_-_Portrait_01.png
1200px-Shishiro_B... png (827.27 KB, 1200x1200)
Here's a thread in /bant/ that has a list of UserScripts for 4chan.
This doesn't include /cumg/ work, but it's nice to know what else exists.


I had a little bad luck.
I guessed the correct URL for ADN-219, but 
the Russian server didn't have the data, so 
it couldn't play it.
I tried ADN-115, and it worked.
We may have found a working pattern for the Russian servers.


Replace "ADN-115" with the code of the video you want, and
this will work for any video that's hosted on Russian servers.
However, many of their recent uploads are not on their Russian servers.
Similar patterns probably exist for their Dutch, French, and German servers, but
I'll leave that as an exercise for the reader.
If this gets automated,
it'll probably be abused again, because
c00mers don't know when to stop.

PS:  I think the "Cen" stands for censored.
Test Subject:

It's not going to be that easy for newer uploads.
I tried to find the URLs for NATR-673 which was
uploaded on January 9, 2022, and 
it's available on DE, NL, and FR servers.
I tried the NL servers, and I found 4 files.
One master.m3u8 and 3 index*.m3u8 files for different resolutions.


The newer files don't follow the simple pattern that the older files do.
> ffmpeg
...tries to download the video parts as fast as possible which makes it hit the Russian server's rate limit often.
ffmpeg will still power through the errors and eventually finish the download, but
it would be nice to slow ffmpeg down to stay under their rate limit.
There doesn't seem to be an easy way to do that though.
> UserScript Resources
thumbnail of 5247472292d132ff1becef71c683b8c3.jpeg
thumbnail of 5247472292d132ff1becef71c683b8c3.jpeg
5247472292... jpeg (81.54 KB, 848x1200)
This is a repo for collecting various userscripts written by anons.
I wrote a userscript for gelbooru, so I can move around and open images with the keyboard, to enhance my cooming™ experience. Any feedback is welcome.

// UserScript
// @name        Keyboard controls for Gelbooru
// @namespace   Booru
// @match*
// @grant       none
// @version     1.0
// @author      anon
// @description 
// /UserScript

const markedBorder = 'solid black 2px';

const search = document.getElementById('tags-search');
const images = document.getElementsByClassName('thumbnail-preview');
const imageHeight = images[0].clientHeight;

let selectedIndex = 0;

const getImagesPerRow = () => {
    const baseOffset = images[0].getBoundingClientRect().y;

    for(let i = 1; i  baseOffset)
            return i;

    return -1;

const isOutsideViewPort = (img) => {
    const rect = img.getBoundingClientRect();

    return ( > (window.innerHeight  document.documentElement.clientHeight)) 
        (rect.bottom  {
    // if we're above images.length - 1, then 
    images[selectedIndex].style.border = '';

    // update the indices
    selectedIndex = i;

    images[selectedIndex].style.border = markedBorder;


const openSelected = () => {
    const link = images[selectedIndex].getElementsByTagName('a')[0].href;;

document.addEventListener('keydown', (event) => {
    if(document.activeElement ! search) {
        if(event.ctrlKey) {
            const paginator = document.getElementById('paginator');
            const links = Array.from(paginator.children);

            // there's only one b element
            const currentPageIndex = links.findIndex(elem => elem.tagName = 'B');
            let pageToGoTo = currentPageIndex;

            switch(event.key) {
                case 'ArrowLeft':
                case 'a':
                case 'h':
                    if(pageToGoTo >= 0 && parseInt(links[pageToGoTo]) !== NaN)
                        window.location = links[pageToGoTo].href;
                case 'ArrowRight':
                case 'd':
                case 'l':
                    if(pageToGoTo = 0 ? selectedIndex - 1 : selectedIndex);
                case 'ArrowRight':
                case 'd':
                case 'l':
                    markSelected(selectedIndex + 1 = 0 ?
                        selectedIndex - imagesPerRow :
                case 'ArrowDown':
                case 's':
                case 'j':
                    markSelected(selectedIndex + imagesPerRow 
pastebin link, because the code block messed up the formatting:
I like how it simultaneously supports:
- Arrow Keys (normies)
- WASD (gamers)
- HJKL (vim users)

These have been added to:
hacked together a tiny userscript to automatically reveal nsfw covers on vndb if anyone's interested:
Simple and to the point.
Very nice.
Use your own bibliogram instance and make your own redirect script
> What's a good instagram mirror
Can someone write a script for patreon/fantia that checks if they have a kemono page and adds a link to it?

41 replies | 8 file

Post(s) action:

Moderation Help

Post Form
New Reply on thread #13
Max 20 files total