diff --git a/backend/app/caption_pool.py b/backend/app/caption_pool.py index 007162b..372798d 100644 --- a/backend/app/caption_pool.py +++ b/backend/app/caption_pool.py @@ -18,6 +18,8 @@ LIMITS = { "shorts": 100, # YouTube title display sweet spot "tiktok": 150, # first-line hook; API allows more "x": 270, # X ~280 with media headroom + "yt_long": 100, # YouTube long-form title + "yt_long_desc": 4900, } # 100 English street-food hooks (base lines, no platform tags yet). @@ -192,6 +194,32 @@ def seed_caption_pool(conn: sqlite3.Connection, *, force: bool = False) -> dict[ (str(uuid.uuid4()), platform, body, i, now), ) counts[platform] = 100 + + # Long-form SEO pools (titles + descriptions) — isolated from Shorts hooks. + try: + from .yt_long_seo import YT_LONG_DESCS, YT_LONG_TITLES + except Exception: + YT_LONG_TITLES = () + YT_LONG_DESCS = () + for platform, items in (("yt_long", YT_LONG_TITLES), ("yt_long_desc", YT_LONG_DESCS)): + row = conn.execute( + "SELECT COUNT(*) AS n FROM caption_pool WHERE platform = ?", + (platform,), + ).fetchone() + n = int(row["n"] if row else 0) + need = len(items) if items else 100 + if n >= need and not force: + counts[platform] = n + continue + if force: + conn.execute("DELETE FROM caption_pool WHERE platform = ?", (platform,)) + for i, body in enumerate(items): + conn.execute( + "INSERT INTO caption_pool(id, platform, body, enabled, sort_order, created_at) " + "VALUES (?, ?, ?, 1, ?, ?)", + (str(uuid.uuid4()), platform, str(body)[:4900], i, now), + ) + counts[platform] = len(items) return counts diff --git a/backend/app/main.py b/backend/app/main.py index 25827c3..317d1a3 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -2754,7 +2754,7 @@ async def caption_pool_status(platform: str = "") -> dict[str, Any]: stats = await _db(caption_pool.pool_stats) plat = str(platform or "").strip().lower() - if plat in {"shorts", "tiktok", "x", "x_clips"}: + if plat in {"shorts", "tiktok", "x", "x_clips", "yt_long", "yt_long_desc"}: key = "x" if plat == "x_clips" else plat samples = await _db(lambda: caption_pool.list_captions(key, limit=5)) return {**stats, "platform": key, "samples": [s.get("body") for s in samples]} diff --git a/backend/app/yt_long_pipeline.py b/backend/app/yt_long_pipeline.py index 9d9b4bf..0549d15 100644 --- a/backend/app/yt_long_pipeline.py +++ b/backend/app/yt_long_pipeline.py @@ -37,41 +37,28 @@ def _rand_clip_sec(cfg: dict[str, Any]) -> int: return random.randint(lo, hi) -def _build_title(job: dict[str, Any], channel: dict[str, Any], cfg: dict[str, Any]) -> str: - tpl = str( - cfg.get("yt_long_title_template") - or channel.get("title_template") - or "{anchor} street food live" - ) - # Strip Shorts hashtags from inherited channel templates - tpl = tpl.replace("#Shorts", "").replace("#shorts", "").strip() +def build_yt_long_copy(job: dict[str, Any], channel: dict[str, Any], cfg: dict[str, Any]) -> dict[str, str]: + """Random SEO title + description (independent rolls; +1 channel custom each).""" + from .yt_long_seo import pick_yt_long_seo + + title_tpl = str(cfg.get("yt_long_title_template") or channel.get("title_template") or "") + desc_tpl = str(cfg.get("yt_long_description_template") or channel.get("description_template") or "") anchor = str(job.get("anchor_name") or job.get("room_id") or "live").strip() url = str(job.get("source_url") or "").strip() room = str(job.get("room_id") or "").strip() - text = ( - tpl.replace("{anchor}", anchor) - .replace("{url}", url) - .replace("{room}", room) - .strip() + picked = pick_yt_long_seo( + title_custom=title_tpl, + desc_custom=desc_tpl, + anchor=anchor, + room=room, + url=url, ) - return (text or f"{anchor} live")[:100] - - -def _build_description(job: dict[str, Any], channel: dict[str, Any], cfg: dict[str, Any]) -> str: - tpl = str( - cfg.get("yt_long_description_template") - or channel.get("description_template") - or "{anchor}\n{url}" - ) - tpl = tpl.replace("#Shorts", "").replace("#shorts", "") - anchor = str(job.get("anchor_name") or "").strip() - url = str(job.get("source_url") or "").strip() - return ( - tpl.replace("{anchor}", anchor) - .replace("{url}", url) - .replace("{room}", str(job.get("room_id") or "")) - .strip() - )[:4900] + return { + "title": str(picked.get("title") or f"{anchor} street food")[:100], + "description": str(picked.get("description") or "")[:4900], + "title_source": str(picked.get("title_source") or ""), + "description_source": str(picked.get("description_source") or ""), + } def pick_yt_long_channel(cfg: dict[str, Any], push_date: str = "") -> dict[str, Any] | None: @@ -612,8 +599,9 @@ class YtLongPipeline: error="频道未授权 Google", ) return - title = _build_title(fresh, channel, cfg) - description = _build_description(fresh, channel, cfg) + copy = build_yt_long_copy(fresh, channel, cfg) + title = copy["title"] + description = copy["description"] privacy = str(channel.get("privacy") or "public") proxy = "" try: diff --git a/backend/app/yt_long_seo.py b/backend/app/yt_long_seo.py new file mode 100644 index 0000000..9c6849e --- /dev/null +++ b/backend/app/yt_long_seo.py @@ -0,0 +1,274 @@ +# -*- coding: utf-8 -*- +"""YouTube long-form SEO title + description pools (English, Asian/Chinese street food). + +Isolated from Shorts: no #Shorts tags. Random pick at upload time +(user channel template optional +1, same pattern as caption_pool). +""" +from __future__ import annotations + +import random +import re +from typing import Any + +# YouTube long-form title sweet spot (~60–90 chars; hard cap 100). +TITLE_LIMIT = 100 +DESC_LIMIT = 4900 + +# 100 SEO titles — search + browse CTR for English audience curious about Asian/Chinese street food. +YT_LONG_TITLES: tuple[str, ...] = ( + "Chinese Street Food That Locals Queue For Every Night", + "Why This $2 Asian Street Snack Tastes Better Than Fine Dining", + "Night Market Food Tour: The Crispiest Chinese Street Bites", + "I Tried Legendary Chinese Street Food at 2AM", + "Asian Street Food Secrets You Won't Find in Restaurants", + "This Chinese Vendor Changed How I Think About Street Food", + "Spicy Chinese Street Noodles That Wake Up the Whole Block", + "Follow the Smoke: Best Chinese Grill Street Food", + "Asian Night Market Classics Every Food Lover Must Try", + "Chinese Street Food ASMR: Sizzle, Crunch, and Sauce", + "Why Travelers Obsess Over Chinese Sidewalk Snacks", + "The Most Addictive Chinese Street Food I've Ever Tasted", + "From Wok to Plate: Real Chinese Street Cooking Up Close", + "Hidden Chinese Food Stall With Lines Around the Corner", + "Sweet, Spicy, Smoky: Perfect Chinese Street Food Combo", + "Asian Street Food You Need to Try Before You Die", + "Chinese Dumplings Fresh Off a Street Cart", + "This Night Market Stall Serves Pure Comfort Food", + "Crispy Chinese Street Fried Snacks Done Right", + "What Chinese Locals Eat After Midnight on the Street", + "Hand-Pulled Noodles on a Chinese Sidewalk", + "The Sauce on This Chinese Street Food Is Unreal", + "Asian Street BBQ That Smells Like a Food Dream", + "Chinese Street Breakfast Worth Waking Up Early For", + "I Found the Best Skewers in a Chinese Night Market", + "Steam Rising: Authentic Chinese Street Soup Dumplings", + "Why This Tiny Chinese Cart Has a Cult Following", + "Spicy Chinese Street Food Challenge (No Mercy Heat)", + "Golden Crispy Chinese Street Snacks Under $3", + "Asian Street Food Therapy After a Long Day", + "Chinese Grilled Seafood Street Style You'll Crave", + "The Crunch on This Chinese Street Bite Is Illegal", + "Night Lights, Night Bites: Chinese Market Food Tour", + "How Chinese Street Chefs Cook So Fast and So Good", + "This Chinese Wrap Street Food Disappears Instantly", + "Savory Chinese Street Classics That Feel Like Home", + "Asian Food Cart Energy You Can Taste", + "Chinese Chili Oil Street Noodles Hitting Different", + "Fresh Dough Meets Open Flame: Chinese Street Bread", + "The Line Told the Truth About This Chinese Stall", + "Chinese Street Dessert After Spicy Food? Always Yes", + "Smoky Chinese Charcoal Grill Street Food Moments", + "Why Asian Night Markets Beat Fancy Restaurants", + "Juicy Chinese Street Bao Fresh From the Steamer", + "This Chinese Vendor Never Misses a Single Order", + "Pepper Heat Chinese Street Food for the Brave", + "Asian Street Soup That Warms You From the First Sip", + "Chinese Fried Rice Street Style With Serious Wok Hei", + "I Followed My Nose to the Best Chinese Street Stall", + "Crispy Outside, Soft Inside: Chinese Street Perfection", + "Chinese Night Market Food That Feels Like a Movie", + "Garlic, Chili, and Fire: Chinese Street Flavor Formula", + "This $1 Chinese Street Snack Hits Harder Than Expected", + "Asian Street Food Flex: Local Favorites Only", + "Chinese Pancakes Sizzling on a Giant Street Griddle", + "Why Everyone Stops for This Chinese Food Cart", + "Tender Chinese Braised Street Bites With Bold Sauce", + "Real Chinese Street Cooking, No Tourist Filter", + "The First Bite of This Chinese Snack Said Everything", + "Asian Market Food Walk: Spicy, Sweet, and Smoky", + "Chinese Skewers Glazed Until They Shine", + "Late-Night Chinese Street Food Run Worth Every Calorie", + "This Stall Makes Chinese Comfort Food Look Easy", + "Crispy Chinese Spring Rolls Straight From Hot Oil", + "Why Chinese Street Food Culture Is Impossible to Resist", + "Hand-Rolled Chinese Street Bites With Fresh Herbs", + "Asian BBQ Smoke Rising From a Busy Sidewalk", + "Chinese Sweet Soy Glaze on Perfect Street Grilled Meat", + "Steam Clouds and Flavor: Chinese Street Kitchen Vibes", + "I Would Cross Town for This Chinese Street Bowl", + "Chinese Night Market MVP: Crispy, Hot, and Loud", + "Soft Bun, Loud Flavor: Chinese Street Sandwich Style", + "The Grill Never Sleeps at This Chinese Food Stall", + "Spiced Just Right: Chinese Street Seasoning Mastery", + "Asian Street Food Plot Twist: Light but Addictive", + "Chinese Chili Crunch Topping That Steals the Show", + "Messy Fingers, Happy Soul: Chinese Street Eating", + "This Chinese Cart Feeds the Whole Neighborhood", + "Fresh-Cut Toppings on Classic Chinese Street Snacks", + "Why This Chinese Street Recipe Must Be Secret", + "Char Marks = Signature: Chinese Grill Street Food", + "Asian Street Noodles Calling My Name at Midnight", + "Chinese Hot Oil Pop and Flavor Explosion Up Close", + "One Plate of Chinese Street Food, Zero Leftovers", + "Local Chinese Favorite for a Very Good Reason", + "Sweet Heat Chinese Street Sauce on a Paper Plate", + "Chinese Street Food Mood: Hungry and Completely Happy", + "That Sizzle Sold Me Instantly at the Night Market", + "Asian Street Classics Done Right Every Single Time", + "Chinese Wok Flames and the Smell of Real Street Food", + "Bite-Sized Chinese Happiness From a Sidewalk Stall", + "This Chinese Food Stall Has Main-Character Energy", + "Savory Hit With a Sweet Finish: Chinese Street Style", + "Queue Was Long for This Chinese Snack — Worth It", + "Chinese Street Cooking Sounds Better Than Music", + "Fresh Off the Wok: Chinese Street Food Still Sizzling", + "Why Curious Food Lovers Chase Chinese Night Markets", + "Asian Street Food Tour: Crispy Skewers and Hot Soup", + "Chinese Chili, Sesame, and Crunch in Every Bite", + "Come Hungry: Ultimate Chinese Street Food Experience", +) + +# 100 SEO descriptions — first lines for CTR, keywords, CTA, hashtags (no #Shorts). +YT_LONG_DESCS: tuple[str, ...] = ( + "Curious about real Chinese street food? Watch locals queue for these sizzling sidewalk bites.\n\nIn this video we explore authentic Asian night-market flavors — crispy, spicy, smoky, and made fresh in front of you.\n\nIf you love Chinese food, Asian street snacks, or night market tours, hit LIKE and SUBSCRIBE for more.\n\nComment your favorite Chinese street food below!\n\n#ChineseStreetFood #AsianFood #StreetFood #NightMarket #FoodTour #ChineseFood #AsiaTravel #Foodie", + "This is the Chinese street snack travelers dream about — cheap, loud, and dangerously good.\n\nWe filmed real Asian street cooking: open flames, wok hei, chili oil, and that first crunch.\n\nNew to Chinese cuisine? Start here. Already obsessed? You already know.\n\nLIKE · SUBSCRIBE · turn on the bell for weekly Asian street food.\n\n#StreetFood #ChineseFood #AsianStreetFood #NightMarket #FoodLover #ChinaFood #Yummy", + "Why do Asians line up for these street stalls every night? One bite answers everything.\n\nThis long-form walk captures Chinese night market energy: steam, smoke, skewers, and secret sauces.\n\nSubscribe if you want more authentic Asian food culture — not tourist traps.\n\n#ChineseStreetFood #AsiaNightMarket #FoodDocumentary #StreetEats #SpicyFood", + "Hot off the grill Chinese street food that tastes better than most restaurants.\n\nFollow the smoke with us through an Asian night market packed with dumplings, noodles, BBQ, and crispy fried snacks.\n\nSupport the channel — LIKE and SUBSCRIBE. Drop a 🔥 if you're hungry.\n\n#ChineseBBQ #StreetFood #AsianFood #NightMarketFood #FoodASMR", + "English-speaking food lovers: if you've never tried real Chinese street food, this is your invitation.\n\nCrispy edges, chili heat, sesame aroma, and vendors who cook at lightning speed.\n\nSubscribe for more Asian street food stories that make you book a flight.\n\n#TryChineseFood #StreetFoodTour #AsianCuisine #FoodTravel", + "Night market therapy: Chinese street food after dark hits different.\n\nWe taste legendary stalls, watch the wok dance, and chase every smoky scent down the alley.\n\nLIKE if this made you hungry. SUBSCRIBE for the next market run.\n\n#NightMarket #ChineseStreetFood #FoodVlog #AsiaFood", + "The $2 Chinese street bite that rivals fine dining — here's why locals are obsessed.\n\nAuthentic Asian street cooking, zero filter, maximum flavor.\n\nComment: noodles, dumplings, or skewers?\n\n#BudgetEats #ChineseFood #StreetFood #AsianSnacks", + "Sauce dripping. Oil crackling. Crowds cheering. Welcome to Chinese street food culture.\n\nThis video is for anyone curious about Asian flavors beyond takeout menus.\n\nSUBSCRIBE for weekly street food deep-dives.\n\n#ChineseCuisine #StreetFoodCulture #FoodieLife #Asia", + "From raw ingredients to sizzling plates in under a minute — Chinese street chefs are unreal.\n\nWatch the craft, smell the chili oil, and feel the night market rush.\n\nLIKE · SUBSCRIBE · share with a friend who needs this.\n\n#WokHei #ChineseStreetFood #CookingASMR #NightMarket", + "Looking for authentic Chinese food inspiration? Start with the sidewalk, not the mall.\n\nAsian street stalls serve the boldest flavors: sweet soy, garlic chili, crisp batter, soft buns.\n\nSubscribe for more China/Asia street food adventures.\n\n#AuthenticChineseFood #StreetFood #AsiaTravel #FoodTour", + "Spicy Chinese street noodles that wake the whole block — and your appetite.\n\nIf you love heat, chili oil, and late-night Asian snacks, this one's for you.\n\nHit the bell so you never miss a market night.\n\n#SpicyNoodles #ChineseFood #StreetFood #ChiliOil", + "Crispy Chinese fried snacks fresh from hot oil. That crunch is the whole point.\n\nWe filmed every sizzle for food lovers who crave Asian street textures.\n\nLIKE if you heard the crunch. SUBSCRIBE for more.\n\n#FriedFood #ChineseStreetFood #ASMRFood #NightMarket", + "Steam rising from Chinese soup dumplings on a busy street corner.\n\nThis is the soft, juicy side of Asian street food — comfort in a bamboo basket.\n\nSubscribe for dumplings, bao, and more Chinese classics.\n\n#SoupDumplings #Xiaolongbao #ChineseFood #StreetEats", + "Hand-pulled noodles on a Chinese sidewalk — stretch, slap, boil, sauce.\n\nReal technique. Real heat. Real Asian street energy.\n\nComment your spice level: mild / medium / no mercy.\n\n#HandPulledNoodles #ChineseNoodles #StreetFood #Asia", + "Chinese grilled skewers glazed until they shine under night market lights.\n\nIf BBQ is your love language, Asian street grills will ruin you (in the best way).\n\nSUBSCRIBE for more smoke and sauce.\n\n#ChineseBBQ #Skewers #StreetFood #NightMarket", + "Sweet Chinese street dessert after spicy food — the perfect night market ending.\n\nCurious about Asian sweets? This stall will convert you.\n\nLIKE · SUBSCRIBE · tell us your favorite dessert.\n\n#ChineseDessert #StreetFood #SweetTooth #AsiaFood", + "Garlic butter, chili crunch, sesame — Chinese street flavor formulas that never miss.\n\nEnglish audience guide to what makes Asian sidewalk food addictive.\n\nSubscribe for more flavor breakdowns.\n\n#ChineseFlavors #StreetFood #FoodEducation #Asia", + "A tiny Chinese cart with a cult following. One menu. Infinite cravings.\n\nWe wait in line, watch the cook, and taste why locals never skip this stall.\n\nLIKE if you'd join the queue.\n\n#LocalEats #ChineseStreetFood #HiddenGem #FoodVlog", + "Chinese breakfast street food worth waking up early for — crispy, savory, and fast.\n\nDiscover morning Asian classics before the city fully wakes.\n\nSUBSCRIBE for breakfast-to-midnight street food.\n\n#ChineseBreakfast #StreetFood #MorningEats #Asia", + "What do Chinese locals eat after midnight? Follow us into the night market.\n\nLate-night Asian street food is pure mood: neon, steam, and bold spice.\n\nHit LIKE and SUBSCRIBE for more midnight runs.\n\n#LateNightEats #ChineseFood #NightMarket #StreetFood", + "Wok hei Chinese fried rice made on the street — that smoky breath of the wok.\n\nIf you've only had takeout rice, this will reset your standards.\n\nSubscribe for more authentic Chinese cooking moments.\n\n#FriedRice #WokHei #ChineseStreetFood #ASMR", + "Soft Chinese bao fresh from the steamer, filled until they nearly burst.\n\nAsian street comfort food that feels like a hug.\n\nLIKE · SUBSCRIBE · comment bao or dumpling?\n\n#Bao #ChineseBuns #StreetFood #ComfortFood", + "Chinese chili oil noodles for brave taste buds — heat with flavor, not just pain.\n\nPerfect for spice lovers discovering Asian street food.\n\nSubscribe if you survive this one.\n\n#ChiliOil #SpicyFood #ChineseNoodles #StreetFood", + "Fresh dough meets open flame: Chinese street bread and pancakes on a giant griddle.\n\nWatch layers crisp, fold, and get drowned in savory sauce.\n\nSUBSCRIBE for more griddle magic.\n\n#ChinesePancake #Jianbing #StreetFood #Asia", + "Why Chinese street food culture beats fancy restaurants for pure flavor joy.\n\nThis video is a love letter to Asian night markets and the people who cook there.\n\nLIKE and SUBSCRIBE to support small-stall storytelling.\n\n#FoodCulture #ChineseStreetFood #NightMarket #TravelFood", + "Crispy spring rolls straight from a Chinese street fryer — golden and gone.\n\nEnglish foodies: this is your next obsession.\n\nHit the bell for weekly Asian crunch content.\n\n#SpringRolls #ChineseFood #StreetSnacks #Foodie", + "Braised Chinese street bites swimming in bold sauce — tender, sticky, unforgettable.\n\nSlow flavor, fast service. That's Asian street food balance.\n\nSUBSCRIBE for more sauce-heavy eats.\n\n#BraisedFood #ChineseCuisine #StreetFood #Yummy", + "Seafood on a Chinese street grill: charcoal, chili, and ocean sweetness.\n\nIf you love Asian BBQ seafood, stay until the end.\n\nLIKE · SUBSCRIBE · share with your food crew.\n\n#GrilledSeafood #ChineseBBQ #StreetFood #NightMarket", + "The first crunch of this Chinese street snack echoes down the alley.\n\nTexture lovers, this one's filmed for you.\n\nSubscribe for more ASMR-leaning Asian food moments.\n\n#FoodASMR #ChineseStreetFood #Crunchy #AsiaEats", + "Secret sauce energy: Chinese vendors who won't share the recipe (we understand).\n\nTaste along as we explore why Asian street sauces hit so hard.\n\nLIKE if sauce is the main character.\n\n#SecretRecipe #ChineseFood #StreetFood #Flavor", + "Asian street food tour highlights: skewers, soup, crispy snacks, and sweet finishes.\n\nShot for curious English audiences who want China/Asia food beyond stereotypes.\n\nSUBSCRIBE to keep walking the markets with us.\n\n#FoodTour #AsianStreetFood #ChineseFood #Travel", + "Messy fingers, happy soul — Chinese street eating etiquette is simple: enjoy.\n\nNo fancy plating. Just heat, salt, spice, and skill.\n\nHit LIKE and SUBSCRIBE.\n\n#StreetEats #ChineseFood #FoodieVibes #Asia", + "This Chinese stall feeds the whole neighborhood every night.\n\nCommunity, craft, and chili — the real story of Asian street food.\n\nSubscribe for human stories behind the stalls.\n\n#LocalFood #ChineseStreetFood #FoodDocumentary #NightMarket", + "Sweet soy glaze on Chinese grilled meat — sticky, shiny, irresistible.\n\nIf caramelized Asian BBQ is your thing, press play.\n\nLIKE · SUBSCRIBE · comment your glaze of choice.\n\n#SweetSoy #ChineseBBQ #StreetFood #FoodLover", + "Hand-rolled Chinese street bites with fresh herbs and crunchy toppings.\n\nFreshness is the flex. Watch it assembled live.\n\nSUBSCRIBE for more build-to-order Asian snacks.\n\n#FreshFood #ChineseStreetFood #Healthyish #Asia", + "Why curious travelers chase Chinese night markets first.\n\nFlavor density, price, and theater — street food is the best city tour.\n\nLIKE if markets > museums sometimes.\n\n#NightMarket #TravelTips #ChineseFood #AsiaTravel", + "Chinese hot oil pop and flavor explosion — cooking ASMR for hungry people.\n\nTurn the volume up. Stay for the sauce pour.\n\nSUBSCRIBE for weekly sizzle.\n\n#CookingASMR #ChineseStreetFood #FoodSounds #StreetFood", + "One plate, zero leftovers: Chinese street portions that vanish fast.\n\nEnglish audience tip: come hungry, leave obsessed.\n\nHit the bell for more market nights.\n\n#Hungry #ChineseFood #StreetFood #FoodVlog", + "Local Chinese favorite for a reason — we taste it and explain the hype.\n\nNo paid promo. Just honest Asian street food curiosity.\n\nLIKE · SUBSCRIBE · share your local favorite.\n\n#LocalFavorite #ChineseStreetFood #HonestReview #Asia", + "Pepper heat Chinese street food with zero mercy — spice challenge vibes.\n\nOnly for heat seekers discovering Asian chili culture.\n\nSubscribe if you like it fiery.\n\n#SpicyChallenge #ChineseFood #Chili #StreetFood", + "Soft bun, loud flavor: Chinese street sandwich-style eats.\n\nCarb lovers, this video is your destination.\n\nLIKE and SUBSCRIBE for more bun content.\n\n#ChineseSandwich #StreetFood #ComfortFood #Asia", + "The grill never sleeps at this Chinese food stall.\n\nAll-night Asian BBQ energy for night owls and foodies.\n\nHit LIKE if you're still hungry at 2AM.\n\n#LateNightBBQ #ChineseStreetFood #NightMarket #Food", + "Spiced just right — Chinese street seasoning that balances heat and aroma.\n\nLearn what your nose is smelling: cumin, chili, sesame, scallion.\n\nSUBSCRIBE for flavor notes with every video.\n\n#Seasoning #ChineseCuisine #StreetFood #FoodEducation", + "Asian street food plot twist: surprisingly light, insanely addictive.\n\nNot every Chinese street bite is heavy — some are fresh, herbal, bright.\n\nLIKE · SUBSCRIBE · comment light or heavy?\n\n#FreshEats #ChineseFood #StreetFood #HealthyFoodie", + "Chinese chili crunch topping that steals every dish.\n\nIf crispy chili is your personality, welcome home.\n\nSubscribe for more topping-focused Asian food clips.\n\n#ChiliCrunch #ChineseFood #StreetFood #Spicy", + "Savory hit with a sweet finish — classic Chinese street flavor arc.\n\nWatch how vendors balance taste like musicians.\n\nLIKE if you love sweet-savory Asian food.\n\n#SweetSavory #ChineseStreetFood #Flavor #NightMarket", + "Queue was long. Worth every minute. Chinese street food patience pays off.\n\nWe document the wait, the cook, and the first bite smile.\n\nSUBSCRIBE for more legendary lines.\n\n#WorthTheWait #ChineseFood #StreetFood #FoodQueue", + "Chinese street cooking sounds better than music — slap, sizzle, pour.\n\nHeadphones recommended.\n\nLIKE · SUBSCRIBE · share with an ASMR friend.\n\n#FoodASMR #ChineseStreetFood #Sounds #Asia", + "Fresh off the wok and still sizzling: Chinese street food at peak heat.\n\nTiming is everything in Asian street cooking.\n\nHit the bell for more hot-plate moments.\n\n#FreshOffTheWok #ChineseFood #StreetFood #Sizzle", + "Ultimate Chinese street food experience for curious English food lovers.\n\nCome hungry. Leave planning your next Asia trip.\n\nLIKE and SUBSCRIBE to support the journey.\n\n#ChineseStreetFood #FoodTravel #Asia #NightMarket #StreetFood", + "Dumpling lovers: Chinese street dumplings boiled, fried, and steamed.\n\nA tasting map for Asian dumpling culture on the sidewalk.\n\nComment your dumpling style!\n\n#Dumplings #ChineseFood #StreetFood #Potstickers", + "Noodle pull, sauce slap, chili drizzle — Chinese street noodles in real time.\n\nIf ramen got you into Asian food, Chinese street noodles go deeper.\n\nSUBSCRIBE for noodle nights.\n\n#ChineseNoodles #StreetNoodles #AsianFood #Foodie", + "Tofu, mushrooms, and plant-forward Chinese street options that still slap.\n\nFlavor first — vegetarian-friendly Asian street ideas included.\n\nLIKE if you want more veggie street food.\n\n#VegetarianStreetFood #ChineseFood #AsiaEats", + "Egg, scallion, chili: simple Chinese street toppings that change everything.\n\nSmall details, huge taste. That's Asian street craft.\n\nSUBSCRIBE for micro-flavor breakdowns.\n\n#Scallion #ChineseStreetFood #FoodTips #NightMarket", + "Paper plate luxury: Chinese street food presentation is honesty.\n\nNo foam. No tweezers. Just heat and skill.\n\nLIKE · SUBSCRIBE · celebrate real food.\n\n#RealFood #ChineseStreetFood #StreetEats #Asia", + "Why English audiences are falling in love with Chinese night markets.\n\nCulture, community, and crunch — explained through food.\n\nHit LIKE if you're planning a food trip.\n\n#NightMarketCulture #ChineseFood #TravelFood #Asia", + "Sesame paste, vinegar, chili oil — the Chinese cold-and-hot sauce trinity.\n\nLearn the flavors that define so many Asian street bowls.\n\nSUBSCRIBE for sauce school.\n\n#Sesame #ChiliOil #ChineseFood #StreetFood", + "Kids, couples, night-shift workers — everyone meets at the Chinese food stalls.\n\nStreet food is social life. This video shows that energy.\n\nLIKE and SUBSCRIBE for more people-and-plate stories.\n\n#FoodCulture #ChineseStreetFood #Community #Asia", + "Cumin-scented Chinese grill skewers that smell like a whole street festival.\n\nIf Xinjiang-style street BBQ calls you, stay till the end.\n\nSUBSCRIBE for more regional Chinese street flavors.\n\n#Cumin #ChineseBBQ #StreetFood #Skewers", + "Rice rolls, rice cakes, sticky bites — Chinese street carbs done right.\n\nChewy texture fans, this is your corner of Asia.\n\nLIKE · SUBSCRIBE · comment chewy or crispy?\n\n#RiceRolls #ChineseFood #StreetSnacks #Asia", + "Soup steam in cold air: Chinese street broth that hugs you instantly.\n\nComfort Asian food filmed for rainy-day cravings.\n\nHit the bell for cozy street eats.\n\n#Soup #ChineseStreetFood #ComfortFood #NightMarket", + "Pickled veggies on Chinese street plates — the crunchy reset button.\n\nBalance is why Asian street meals keep you going for round two.\n\nSUBSCRIBE for more palate-cleanser moments.\n\n#Pickles #ChineseFood #StreetFood #FlavorBalance", + "Tea eggs, roasted nuts, small bites: Chinese street snacks between the big plates.\n\nThe supporting cast of Asian night markets deserves love too.\n\nLIKE if you snack while you walk.\n\n#TeaEgg #ChineseSnacks #StreetFood #Asia", + "Watch a Chinese street chef multitask five pans without blinking.\n\nSpeed, accuracy, and taste — elite Asian street kitchen skills.\n\nSUBSCRIBE for chef-focus episodes.\n\n#StreetChef #ChineseCooking #FoodSkills #NightMarket", + "From first sizzle to last bite: a full Chinese street meal story.\n\nDesigned for English viewers who want immersion, not just clips.\n\nLIKE · SUBSCRIBE · share with a food-obsessed friend.\n\n#FoodStory #ChineseStreetFood #LongForm #Asia", + "Sticky rice Chinese street parcels wrapped with aroma and surprise fillings.\n\nUnwrap Asia one bite at a time.\n\nHit LIKE if you love surprise fillings.\n\n#StickyRice #ChineseFood #StreetFood #FoodSurprise", + "Clay pot vibes on the street: Chinese bubbling comfort in a portable form.\n\nHear the bubble. Smell the soy. Taste the crust.\n\nSUBSCRIBE for more hot-pot-adjacent street eats.\n\n#ClayPot #ChineseFood #StreetFood #Comfort", + "Fish balls, meatballs, street simmer pots — Chinese skewered snacks in broth.\n\nPlayful Asian street eating for all ages.\n\nLIKE and SUBSCRIBE!\n\n#FishBalls #ChineseStreetFood #NightMarket #Snacks", + "Why wok temperature is the secret of great Chinese street stir-fry.\n\nWe show the flame, the toss, and the aroma cloud.\n\nSUBSCRIBE for more cooking-science-with-flavor videos.\n\n#StirFry #Wok #ChineseStreetFood #Cooking", + "Honey chili Chinese street glaze that sticks to everything (including your mind).\n\nSweet heat fans, assemble.\n\nLIKE · SUBSCRIBE · comment honey chili or dry spice?\n\n#HoneyChili #ChineseFood #StreetFood #SweetHeat", + "Roasted sweet potato and simple Chinese street classics that feel nostalgic.\n\nNot every Asian night market bite needs to be extreme — some just feel like home.\n\nHit LIKE for cozy eats.\n\n#NostalgiaFood #ChineseStreetFood #SimpleEats #Asia", + "Walking tour energy: Chinese street food from stall to stall without rushing.\n\nLong-form for people who want to linger in the market atmosphere.\n\nSUBSCRIBE to walk with us again next week.\n\n#WalkingTour #NightMarket #ChineseFood #FoodTravel", + "Crispy chicken Chinese street fry with a crackling coat.\n\nIf fried chicken is your religion, Asian street versions are a pilgrimage.\n\nLIKE and SUBSCRIBE for crunch.\n\n#FriedChicken #ChineseStreetFood #Crispy #Foodie", + "Beef noodle energy on a Chinese sidewalk — rich broth, tender meat, chili on top.\n\nA classic Asian bowl that converts almost everyone.\n\nComment if beef noodles are undefeated.\n\n#BeefNoodles #ChineseFood #StreetFood #ComfortFood", + "Stinky tofu curiosity: Chinese street food that shocks then addicts.\n\nBrave eaters only — but the payoff is real.\n\nSUBSCRIBE for more adventurous Asian bites.\n\n#StinkyTofu #ChineseStreetFood #AdventurousEater #NightMarket", + "Scallion oil noodles: Chinese street minimalism with maximum aroma.\n\nProof that Asian flavor doesn't need a long ingredient list.\n\nLIKE · SUBSCRIBE · try it at home after watching.\n\n#ScallionOilNoodles #ChineseFood #SimpleRecipes #StreetFood", + "Market lights, vendor shouts, and Chinese street food chaos that somehow feels perfect.\n\nImmersive Asian night market vibes for your next watch party.\n\nHit the bell so you don't miss the next city.\n\n#NightMarketVibes #ChineseStreetFood #Atmosphere #Asia", + "Learn the difference: tourist Chinese food vs real street stalls.\n\nThis video helps English audiences find authentic Asian flavors.\n\nLIKE if you want fewer tourist traps.\n\n#AuthenticFood #ChineseStreetFood #TravelTips #FoodGuide", + "Corn, sausage, squid — Chinese night market skewers beyond the usual.\n\nVariety is the soul of Asian street eating.\n\nSUBSCRIBE for more skewer seasons.\n\n#Skewers #NightMarket #ChineseFood #StreetSnacks", + "Black vinegar splash on Chinese dumplings — the move that unlocks flavor.\n\nSmall sauce tips for bigger enjoyment of Asian street food.\n\nLIKE · SUBSCRIBE · share a sauce tip of your own.\n\n#BlackVinegar #Dumplings #ChineseFood #FoodHacks", + "Rainy night Chinese street food tastes better. We filmed the proof.\n\nSteam plus rain plus chili = cinema.\n\nHit LIKE if rainy food nights are elite.\n\n#RainyDay #ChineseStreetFood #MoodEats #NightMarket", + "Family-run Chinese stalls where recipes travel generations on the sidewalk.\n\nAsian street food is heritage you can eat.\n\nSUBSCRIBE for more family-kitchen stories.\n\n#FamilyBusiness #ChineseFood #Heritage #StreetFood", + "Crispy tofu pockets stuffed with Chinese street fillings.\n\nTexture contrast heaven for food nerds.\n\nLIKE and SUBSCRIBE for more stuffed snacks.\n\n#Tofu #ChineseStreetFood #Stuffed #AsiaEats", + "How to order at a Chinese street stall when you don't speak the language.\n\nSmile, point, and trust the queue — Asia food tip included.\n\nSUBSCRIBE for traveler-friendly food guides.\n\n#TravelTips #ChineseStreetFood #LanguageBarrier #FoodTravel", + "Sugar-roasted and candied Chinese street treats for the sweet finish.\n\nSave room. Asian night markets always have dessert.\n\nComment your sweet tooth level.\n\n#CandiedFruit #ChineseDessert #StreetFood #Sweet", + "Microwave? Never. Chinese street food is fire, steel, and timing.\n\nRespect the craft. Taste the difference.\n\nLIKE · SUBSCRIBE · celebrate street chefs.\n\n#StreetChef #ChineseCooking #RealCooking #NightMarket", + "Map your craving: spicy, crispy, soupy, or sweet Chinese street routes.\n\nUse this video as a flavor compass for Asian markets.\n\nHit the bell for more edible maps.\n\n#FoodMap #ChineseStreetFood #AsiaTravel #Guide", + "Close-up Chinese knife work on the street — speed without losing precision.\n\nASMR chopping plus flavor payoff.\n\nSUBSCRIBE for more knife-and-wok sessions.\n\n#KnifeSkills #ChineseFood #ASMR #StreetFood", + "Why Chinese street food portions feel generous and prices feel kind.\n\nValue + flavor is the Asian sidewalk promise.\n\nLIKE if budget delicious is your love language.\n\n#BudgetTravel #ChineseStreetFood #ValueEats #Asia", + "From first curious glance to last spicy bite — a full Chinese market immersion.\n\nMade for English audiences who want Asia on their screen tonight.\n\nLIKE and SUBSCRIBE. See you at the next stall.\n\n#Immersion #ChineseStreetFood #FoodTour #NightMarket #AsianFood", + "Sesame candy pulls and Chinese street confection craft.\n\nSweet theater you can taste.\n\nHit LIKE if you love food performance.\n\n#SesameCandy #ChineseSweets #StreetFood #FoodShow", + "Grilled eggplant Chinese street style with garlic sauce that owns the plate.\n\nVegetable dishes can still be the star of Asian street food.\n\nSUBSCRIBE for more veggie heroes.\n\n#Eggplant #ChineseFood #GarlicSauce #StreetFood", + "Milk tea nearby, chili on your lips: classic Chinese night market pairing.\n\nDrink + spice strategy for longer tasting sessions.\n\nLIKE · SUBSCRIBE · comment your pairing.\n\n#MilkTea #NightMarket #ChineseStreetFood #Pairing", + "The smile after the first bite — Chinese street food's universal language.\n\nNo translation needed. Just flavor.\n\nHit the bell for more smile-worthy stalls.\n\n#FoodMakesHappy #ChineseFood #StreetFood #Asia", + "Build-your-own Chinese street bowls: pick protein, heat level, and toppings.\n\nInteractive Asian eating for curious newcomers.\n\nSUBSCRIBE to learn ordering patterns.\n\n#BuildYourOwn #ChineseStreetFood #FoodGuide #NightMarket", + "Charcoal glow on Chinese BBQ — the color of appetite.\n\nVisual feast + flavor feast for long-form watching.\n\nLIKE and SUBSCRIBE if you stayed to the end.\n\n#CharcoalBBQ #ChineseStreetFood #FoodCinematography #Asia", + "Final tip: the best Chinese street stall is often the one with the longest local line.\n\nFollow people, follow smoke, follow your curiosity.\n\nSUBSCRIBE for more rules of delicious Asia.\n\n#FoodTips #ChineseStreetFood #NightMarket #TravelEats", + "Thanks for watching this Chinese street food journey.\n\nIf it made you hungry for Asian flavors, LIKE, SUBSCRIBE, and tell us which dish you'd try first.\n\nMore night markets coming soon.\n\n#ChineseStreetFood #AsianFood #StreetFood #NightMarket #Foodie #Subscribe", + "English foodies welcome: Chinese street food is the fastest way to understand Asia.\n\nSpice, smoke, sweetness, and community on every plate.\n\nLIKE · SUBSCRIBE · see you in the next queue.\n\n#LearnThroughFood #ChineseFood #Asia #StreetFoodCulture", + "Still hungry? Rewatch the sizzle, then go find your nearest Asian night market vibes.\n\nWe film so you can crave smarter.\n\nHit LIKE and SUBSCRIBE for the next legendary stall.\n\n#StayHungry #ChineseStreetFood #FoodCravings #NightMarket", +) + +assert len(YT_LONG_TITLES) == 100, len(YT_LONG_TITLES) +assert len(YT_LONG_DESCS) == 100, len(YT_LONG_DESCS) + + +def _render_custom(template: str, *, anchor: str = "", room: str = "", url: str = "") -> str: + text = str(template or "") + reps = { + "{anchor}": anchor or "", + "{room}": room or "", + "{url}": url or "", + "{title}": anchor or "", + "{name}": anchor or "", + } + for k, v in reps.items(): + text = text.replace(k, v) + text = text.replace("#Shorts", "").replace("#shorts", "") + return re.sub(r"[ \t]+", " ", text).strip() + + +def pick_yt_long_seo( + *, + title_custom: str = "", + desc_custom: str = "", + anchor: str = "", + room: str = "", + url: str = "", +) -> dict[str, Any]: + """Random title from 100 (+ optional custom) and independent random description.""" + title_opts: list[tuple[str, str]] = [("pool", t[:TITLE_LIMIT]) for t in YT_LONG_TITLES] + custom_t = _render_custom(title_custom, anchor=anchor, room=room, url=url) + if custom_t: + title_opts.append(("custom", custom_t[:TITLE_LIMIT])) + t_src, title = random.choice(title_opts) + + desc_opts: list[tuple[str, str]] = [("pool", d[:DESC_LIMIT]) for d in YT_LONG_DESCS] + custom_d = _render_custom(desc_custom, anchor=anchor, room=room, url=url) + if custom_d: + desc_opts.append(("custom", custom_d[:DESC_LIMIT])) + d_src, description = random.choice(desc_opts) + + title = title.replace("#Shorts", "").replace("#shorts", "").strip()[:TITLE_LIMIT] + description = description.replace("#Shorts", "").replace("#shorts", "").strip()[:DESC_LIMIT] + return { + "title": title or "Chinese Street Food Night Market", + "description": description or title, + "title_source": t_src, + "description_source": d_src, + "title_pool_size": len(YT_LONG_TITLES), + "description_pool_size": len(YT_LONG_DESCS), + } diff --git a/frontend/src/app/yt-long/page.tsx b/frontend/src/app/yt-long/page.tsx index ddd8998..a8cc7a3 100644 --- a/frontend/src/app/yt-long/page.tsx +++ b/frontend/src/app/yt-long/page.tsx @@ -74,8 +74,8 @@ const emptyForm = { name: "", enabled: true, daily_max: 1, - title_template: "{anchor} street food live", - description_template: "{anchor}\n{url}\n#StreetFood #Live", + title_template: "", + description_template: "", privacy: "public", note: "", oauth_profile_id: "A", @@ -734,19 +734,21 @@ export default function YtLongPage() {