Sunday, 17 May 2026

The Ghost writes web-based youtube-Anti-Click-Bait for us

 Welcome to this Brave New World (pun intended), where we don't need to write software—all we need to do is ask a robot to write it for us.

We just have to describe it...

Let's see the process:

We log into the Linux VM:

We install OpenCode on that machine by running the command:
curl -fsSL https://opencode.ai/install | bash

A few seconds later, OpenCode salutes us:

nobait@Dev-Station:~$ curl -fsSL https://opencode.ai/install | bash

Installed version: 1.15.0.


Installing opencode version: 1.15.4

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100%


                                      

█▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█

█░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀

▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀  ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀



OpenCode includes free models, to start:


cd <project>  # Open directory

opencode      # Run command


For more information visit https://opencode.ai/docs



nobait@Dev-Station:~$ 


We now need to install the config file (~/.config/opencode/opencode.json) that will let us use our local model for development, as I mentioned in the previous post.

Actually, this is not a necessary step. Currently, OpenCode gives free access to some very capable and fast models like DeepSeekv4Flash, so we don't have to use a local model.

But, since I have a local model that is needed for the youtube-noBait app, I will go one step further and use this model to write the app too.

Now, this is important and shows the real potential of OpenCode and other tools that allow for local models: The code the system writes for you never leaves your network. Your design and algorithms remain in a safe area.

Of course, this is not much of a worry in this case since I provide the code here and on GitHub, but for a real project, it can be important.

Before we start, lets make sure the environment (models etc) is up and running.

nobait@Dev-Station:~$ ./yt-summary.sh https://youtu.be/NYmXYF8A3Q4

------------------------------------------------

🚀 PROCESS STARTED

------------------------------------------------

📥 Downloading & Extracting Audio...

[youtube] Extracting URL: https://youtu.be/NYmXYF8A3Q4

[youtube] NYmXYF8A3Q4: Downloading webpage

WARNING: [youtube] No supported JavaScript runtime could be found. Only deno is enabled by default; to use another runtime add  --js-runtimes RUNTIME[:PATH]  to your command/config. YouTube extraction without a JS runtime has been deprecated, and some formats may be missing. See  https://github.com/yt-dlp/yt-dlp/wiki/EJS  for details on installing one

[youtube] NYmXYF8A3Q4: Downloading android vr player API JSON

[info] NYmXYF8A3Q4: Downloading 1 format(s): 251

[download] Destination: audio_1779081875.webm

[download] 100% of   12.18MiB in 00:00:00 at 18.41MiB/s

[ExtractAudio] Destination: audio_1779081875.wav

Deleting original file audio_1779081875.webm (pass -k to keep)

⏱️  Audio Duration: 15m 11s

✍️  Transcribing (Whisper Turbo v3)...

✅ Done! Transcription Time: 33.83 seconds

🧠 Summarizing (Qwen 3.6)...

------------------------------------------------

📝 SUMMARY RESULT

------------------------------------------------

Here is a summary of the video transcript, broken down by key themes and arguments:


[I removed the long summary for brevity...]

------------------------------------------------

⏱️  Summary Time: 20.33 seconds

🧹 Cleaning up...

🏁 All done.

nobait@Dev-Station:~$ 


OK, we have verified the cli version works.

Now we will tell OpenCode to write the same with a web front end plus a few bells and whistles...

Actually I have created a prompt and saved as a text file (~/oc-instructions.txt) and all I will tell opencode is 

Please read @~/oc-instructions.txt and build the application exactly as described

so here it goes:

It took it exactly 1 minute.
It took me 10 minutes to just describe what I want and much more to write this post.
We are toasted...

The presentation of the actual application OpenCode created, on the next post...

The prompt I gave opencode to write the app was:

Act as an expert Full-Stack Python Developer. Examine the file `~/yt-summary.sh` and use the tools, endpoints (IPs/ports), models, and mechanisms this bash script uses in order to build the following web-based Python application.

### Step 1: Project Setup
Before writing the code, please provide the exact terminal commands to:
1. Create a new project folder named `yt-watcher`.
2. Navigate into that folder.
3. Create a Python virtual environment (`venv`).
4. Activate the virtual environment.
5. Create a `requirements.txt` file containing the necessary dependencies (e.g., `Flask` or `FastAPI`, the `yt-dlp` python module, and `requests`).

### Step 2: The Application UI (Frontend)
Create a minimalist, clean HTML/CSS frontend reminiscent of the classic Google search page. 
- **Centerpiece:** A prominent text block with exactly this text: 
  > "Don't waste your time watching bullshit YouTube videos, let me watch it first and I will tell you if it is worth watching, if it is not a click bait, and if it is not, I will also give you an extensive summary, so that even if it is worth watching, you may save time by reading the summary."
- **Input Area:** A text entry field for the YouTube URL.
- **Action Button:** Directly to the right of the text field, place a button labeled: "Watch the video for me".
- **Loading State:** When the button is clicked, show a loading indicator so the user knows the background processes are running.
- **Results Display & Toggling Logic:** - The backend will return a short judgment, a value rating, and the extensive summary all at once.
  - Initially, display ONLY the 2-3 line clickbait judgment and the "Value Rating".
  - Below this judgment, include a button labeled: "Display Extensive Summary".
  - Render the extensive summary in the HTML directly below this button, but keep it hidden by default (e.g., using CSS `display: none;`).
  - When the user clicks "Display Extensive Summary", use vanilla JavaScript to toggle the visibility of the hidden summary `div` to show it.

### Step 3: Application Logic (Backend)
Use a lightweight Python web framework. The backend must replicate the exact workflow of the `~/yt-summary.sh` script, extracting the remote host IPs, ports, and models directly from that file.

**1. Download & Extract Audio:**
Replicate the `yt-dlp` logic from the bash script using the `yt-dlp` Python library (do not use subprocess to call the CLI). Extract the same audio format and post-processing arguments (sample rate, channels) defined in the script.

**2. Transcribe (Whisper):**
Send the downloaded audio file via a POST request to the transcription server. Extract the exact IP, port, and form data arguments directly from the bash script.

**3. Analyze & Summarize (Qwen):**
Take the resulting text transcript and send it to the LLM server via a POST request. Extract the IP, port, model name, and temperature from the bash script.
- **Crucial System Prompt Update:** You must update the LLM system prompt found in the bash script to instruct the model to output its response in strict JSON format. This allows the backend/frontend to easily separate the judgment from the summary. Change the system prompt to something like this:
  *"You are a professional assistant evaluating YouTube transcripts. Output your response in strict JSON format with three keys: 'clickbait_judgment' (2-3 lines evaluating if the title/premise was clickbait), 'value_rating' (a score out of 10 based on information density), and 'extensive_summary' (a detailed bulleted summary of the video)."*

**4. Cleanup:**
Ensure the backend deletes the temporary audio file and clears variables from memory after processing is complete, mirroring the cleanup in the bash script.

Please provide the complete Python backend code, the HTML/JS/CSS templates, and the exact directory structure I should use.

But don't let this long description discourage you!


As I said before, we can use a can use a chatbot, like ChatGPT, Gemini etc, or even out own LLM, to talk to the chatboat about it and let the chatbot buidl the detailed OpenCode prompt for us...


It is getting worse, no???

No comments:

Post a Comment