Skip to content

Instantly share code, notes, and snippets.

View thedtvn's full-sized avatar

The DT thedtvn

View GitHub Profile
/**
* OpenCode OmniRoute Plugin (OpenCode V2)
*
* OpenAI-compatible API router with:
* - API key + base URL captured through a registered integration (`/connect`, `opencode auth login`)
* - Automatic model discovery via GET {baseURL}/models
* - Model metadata enrichment from models.dev (context, output limits, reasoning)
*/
import { Integration, Model, Plugin, Provider } from "@opencode/plugin"
@thedtvn
thedtvn / mbcaptcha.user.js
Last active June 5, 2026 23:19
Auto bypass captcha
// ==UserScript==
// @name Anto Bypass MBBank Captcha
// @namespace http://tampermonkey.net/
// @version 2026-05-28
// @description Auto bypass captcha
// @author The DT
// @match https://online.mbbank.com.vn/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=mbbank.com.vn
// @run-at document-start
// @grant unsafeWindow
@thedtvn
thedtvn / openor.ts
Last active June 24, 2026 18:02
Migrade from 9router to omniroute since 9router unstable as fuck
/**
* OpenCode omniroute Plugin
*
* OpenAI-compatible API router with:
* - Custom base URL (user-provided)
* - API key auth persisted to ~/.local/share/opencode/auth.json
* - Automatic model discovery via GET /v1/models
* - Model metadata enrichment from models.dev (context, output limits, reasoning)
*/
@thedtvn
thedtvn / open9r.ts
Last active May 14, 2026 01:36
A plugin script support native 9Router on opencode
/**
* OpenCode 9Router Plugin
*
* OpenAI-compatible API router with:
* - Custom base URL (user-provided)
* - API key auth persisted to ~/.local/share/opencode/auth.json
* - Automatic model discovery via GET /v1/models
* - Model metadata enrichment from models.dev (context, output limits, reasoning)
*/
from mitmproxy import tls, connection
from mitmproxy.script import concurrent
from tldextract import extract
import secrets
block_domain = set()
skip_domain = set()
modify_sni = {}
@thedtvn
thedtvn / download_pdf_drive.py
Last active March 10, 2024 13:25
download pdf from drive drive that block download
import io
import re
import json
import requests
import demjson3
from PIL import Image
import urllib.parse as parse
file = input("file url: ")
@thedtvn
thedtvn / down_pdf_onedrive.py
Last active March 10, 2024 13:26
download pdf onedrive that block download
import json
import re
import requests
from urllib.parse import urlparse, parse_qs
file = input("File url: ")
def custom_url_encode(input_string):
encoded_string = ""