Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MHTok - TikTok MHTML Data Extractor

An OSINT-focused tool designed to extract and analyze data from archived TikTok pages saved in the MHTML format.

Overview

MHTok processes MHTML files to extract metadata like video descriptions, video urls, author names, views, hashtags, and it compiles this information into clean CSV datasets.

Features

  • Local-First Processing: All data processing happens offline - no external API calls or network requests
  • MHTML Parsing: Extracts HTML content from MHTML archive files
  • Metadata Extraction:
    • Video ID and URL
    • Author source (profile owner) and post creator (video author)
    • Description
    • View counts
    • Hashtags
    • Music information
    • Repost detection with creator attribution
  • Multiple Export Formats: CSV and JSON export options
  • Data Filtering: Search and filter extracted data by author or content
  • Batch Processing: Process multiple MHTML files at once
  • User-Friendly Interface: Drag-and-drop file upload with Streamlit

Installation

Prerequisites

  • Python 3.8 or higher
  • pip package manager

Setup

  1. Clone or download this repository:
cd mhtok-app
  1. Install dependencies:
pip install -r requirements.txt

Usage

Step 1: Capture TikTok Pages as MHTML

  1. Install a browser extension like "Save as MHTML" or use your browser's built-in save feature
  2. Navigate to a TikTok video or profile page
  3. Save the page as MHTML format

Supported Page Types:

  • User profile pages (e.g., https://www.tiktok.com/@username)

Step 2: Run MHTok

  1. Start the Streamlit application:
streamlit run app.py
  1. Your browser will open automatically to http://localhost:8501

Step 3: Process MHTML Files

  1. Drag and drop your MHTML files into the upload area
  2. Click "Process Files" to extract the data
  3. Review the extracted metadata in the data table
  4. Use filters to search or narrow down results
  5. Export your data as CSV or JSON

Extracted Data Fields

Field Description
video_id Unique TikTok video identifier
video_url Full URL to the video
author_source Profile owner (person whose profile was captured)
post_creator Video creator (extracted from video URL)
description Video caption/description
views View count (parsed from HTML)
hashtags Comma-separated list of hashtags
music Background music/sound title
is_repost Boolean flag indicating if video is a repost
source_file Original MHTML filename

Understanding Author Fields

author_source vs post_creator:

  • For regular posts: author_source == post_creator (same person)
  • For reposts: author_source != post_creator (different people)
    • author_source: Who reposted it (profile owner)
    • post_creator: Who originally created it (from video URL)

Limitations

  • Static Content Only: MHTML captures only what was visible when the page was saved
  • Unavailable Fields: Likes, comments, shares, and timestamps are not available
  • Data Freshness: Data is only as current as when the MHTML was saved
  • Page Changes: TikTok's HTML structure may change, requiring updates to the extractor

Missing metadata fields

  • Some fields may not be available on all TikTok pages
  • Private or restricted content may have limited metadata
  • Older MHTML files may use different HTML structures

Installation issues

# Update pip
pip install --upgrade pip

# Install with verbose output
pip install -r requirements.txt -v

About

An OSINT-focused tool designed to extract and analyze data from archived TikTok pages saved in the MHTML format.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages