Before hitting play, look in the video description for "硬字幕" (Hard subs) or check the settings (gear icon). Ensure the subtitle track says "Bahasa Indonesia" . Most popular uploads have baked-in Sub Indo.
def handle_search_query(raw_query):
# 1. Decode HTML entities
decoded_query = html_decoder(raw_query)
# "sorcerer 39s stone" -> "sorcerer's stone"
# 2. Extract Intent Keywords
language_intent = extract_language(decoded_query) # returns 'Indonesian'
platform_intent = extract_platform(decoded_query) # returns 'Bilibili'
# 3. Clean Title String
clean_title = remove_keywords(decoded_query, ['sub indo', 'bilibili', 'full', 'download'])
# 4. Database Search
results = database.search(clean_title)
# 5. Filtering
if language_intent == 'Indonesian':
results = filter_by_subtitle(results, 'id')
if "full" in raw_query:
results = filter_by_duration(results, type='movie')
# 6. Routing
if len(results) == 1:
# Deep link directly to player/content page
return redirect_to_content_page(results[0], preset_subtitle='id')
else:
# Return standard list view
return display_search_results(results)
Scenario: User pastes harry potter and the sorcerer 39s stone sub indo bilibili full into the search bar. Before hitting play, look in the video description
Step 1: The Loading State
Step 2: The Result (Success)
Step 3: The Result (Partial Success)
Grab your popcorn (or Chocolate Frogs) and press play. Scenario: User pastes harry potter and the sorcerer