Skip to content

testrana15-dev/h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Complete Setup Guide — YouTube + Archive.org Dual Upload Bot

📁 Files Overview

drt_project/
├── bot.py               ← Main bot (updated - dual upload)
├── database.py          ← MongoDB (updated - dono links save)
├── youtube_uploader.py  ← YouTube multi-account (same as before)
├── archive_uploader.py  ← NEW — Archive.org uploader
├── requirements.txt     ← Dependencies
└── yt_accounts/         ← YouTube tokens folder (auto-banta hai)

✅ PART 1 — Archive.org Account Setup (5 min)

Step 1: Account Banao

  1. https://archive.org pe jao
  2. Sign Up karo (free)
  3. Email verify karo

Step 2: API Keys Lo

  1. Login karo
  2. https://archive.org/account/s3.php pe jao
  3. "Generate new API keys" button dabao
  4. S3 Access Key aur S3 Secret Key copy karo aur safe rakh lo
Access Key: XXXXXXXXXXXXXXXX  (yahi hai ARCHIVE_ACCESS_KEY)
Secret Key: XXXXXXXXXXXXXXXX  (yahi hai ARCHIVE_SECRET_KEY)

⚠️ Kisi ko mat batana — yeh keys tumhare account ka password hai


✅ PART 2 — Environment Variables Set Karo

Railway pe:

BOT_TOKEN          = (Telegram bot token from @BotFather)
API_ID             = (my.telegram.org se)
API_HASH           = (my.telegram.org se)
MONGO_URI          = (MongoDB Atlas connection string)
OWNER_ID           = (Tumhara Telegram User ID)
YOUTUBE_CLIENT_ID  = (Google Cloud Console se)
YOUTUBE_CLIENT_SECRET = (Google Cloud Console se)
ARCHIVE_ACCESS_KEY = (archive.org/account/s3.php se)  ← NEW
ARCHIVE_SECRET_KEY = (archive.org/account/s3.php se)  ← NEW
ARCHIVE_USERNAME   = (tumhara archive.org username)    ← NEW (optional)
LOG_CHANNEL        = (Telegram channel ID, optional)
ADMIN_LINK         = (Admin Telegram link, optional)
PORT               = 8080

Replit pe:

Secrets tab mein same variables daalo.


✅ PART 3 — YouTube Setup (Pehle Jaisa)

  1. https://console.cloud.google.com pe jao
  2. New Project banao
  3. YouTube Data API v3 enable karo
  4. OAuth 2.0 Client ID banao (Desktop App type)
  5. Client ID aur Secret copy karo → Environment variables mein daalo
  6. Test users mein apni Gmail add karo

Bot mein:

/addaccount MeraChannel

→ Link aayega → Google login → Code copy → /code MeraChannel XXXX


✅ PART 4 — Deploy Karo

Railway:

# Repo fork karo ya clone karo
git clone https://github.com/testrana15-dev/Drt
cd Drt

# Nayi files replace karo:
# bot.py, database.py, youtube_uploader.py, requirements.txt
# archive_uploader.py ADD karo (nai file hai)

git add .
git commit -m "Add Archive.org dual upload"
git push

Railway automatically redeploy karega.

Dockerfile already sahi hai — kuch change nahi karna.


📱 Bot Use Karna

Video Upload Karo:

  1. Telegram pe video bhejo (MP4, MKV, AVI, WebM, MOV)
  2. Bot automatically:
    • ✅ YouTube pe upload karega (unlisted)
    • ✅ Archive.org pe upload karega (permanent)
  3. Dono links milenge ek message mein

Success Message Example:

✅ Upload Complete! 🎉

📌 Title: Meri Video
📦 Size: 45.2 MB

🎬 YouTube (Unlisted):
🔗 https://youtu.be/XXXXXXXX

📦 Archive.org (Permanent | Custom Player ke liye):
🔗 Direct MP4: https://archive.org/download/tgbot-meri-video-abc123/video.mp4
🖥️ Embed: https://archive.org/embed/tgbot-meri-video-abc123

💾 MongoDB me save ✅

🎬 Custom Video Player mein Use Kaise Karo

Archive.org ka Direct MP4 link apne player mein:

<video controls>
  <source src="https://archive.org/download/IDENTIFIER/video.mp4" type="video/mp4">
</video>

Ya Video.js player ke saath:

<link href="https://vjs.zencdn.net/8.0.4/video-js.css" rel="stylesheet">
<script src="https://vjs.zencdn.net/8.0.4/video.min.js"></script>

<video id="myVideo" class="video-js" controls preload="auto" width="640" height="360">
  <source src="https://archive.org/download/IDENTIFIER/video.mp4" type="video/mp4">
</video>
<script>
  var player = videojs('myVideo');
</script>

❓ FAQ

Q: Archive.org pe video kitne din rehta hai? A: Permanent — hamesha ke liye. Archive.org ek non-profit hai.

Q: Kya Archive.org pe koi daily limit hai? A: Nahi — unlimited uploads.

Q: Archive.org video private rakh sakte hain? A: Nahi, sab public hota hai. Links unlisted nahi hote — koi bhi dekh sakta hai agar link mila.

Q: Agar YouTube quota khatam ho jaye? A: Archive.org wala link phir bhi milega. YouTube link kal milega (pending system).

Q: MongoDB mein kya save hota hai? A: title, yt_link, yt_id, archive_link, archive_embed, archive_id, size_mb, user_id, file_unique_id, uploaded_at


🆘 Troubleshooting

Problem Solution
Archive upload fail ARCHIVE_ACCESS_KEY aur SECRET check karo
YouTube quota exceeded Kal pending retry hoga ya zyada accounts add karo
Bot start nahi ho raha BOT_TOKEN aur API_ID/HASH check karo
MongoDB connect error MONGO_URI check karo — IP whitelist karo Atlas mein

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages