{"id":51273200,"url":"https://github.com/deltek/myepg","last_synced_at":"2026-06-29T20:00:34.664Z","repository":{"id":368218425,"uuid":"1284005669","full_name":"Deltek/MyEPG","owner":"Deltek","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-29T15:47:25.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-29T16:07:50.205Z","etag":null,"topics":["telegram","telegrambot","vibe-coded","vibe-coding"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Deltek.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-29T12:42:51.000Z","updated_at":"2026-06-29T15:47:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Deltek/MyEPG","commit_stats":null,"previous_names":["deltek/myepg"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Deltek/MyEPG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deltek%2FMyEPG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deltek%2FMyEPG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deltek%2FMyEPG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deltek%2FMyEPG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Deltek","download_url":"https://codeload.github.com/Deltek/MyEPG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deltek%2FMyEPG/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34941027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["telegram","telegrambot","vibe-coded","vibe-coding"],"created_at":"2026-06-29T20:00:17.245Z","updated_at":"2026-06-29T20:00:34.639Z","avatar_url":"https://github.com/Deltek.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📺 MyEPG — Bot Programme TV Telegram\n\nUn bot Telegram intelligent pour consulter les programmes TV en temps réel. Accès aux EPG (Electronic Program Guides) France et Royaume-Uni avec filtrage avancé (films, séries, sport, inédits).\n\n## ✨ Fonctionnalités\n\n### 📡 Consultations EPG\n- **`/maintenant`** — Programme en direct (par pays ou chaîne)\n- **`/soir`** — Soirée TNT FR (19h-00h)\n- **`/prime`** — Prime time 20h-22h30\n- **`/demain`** — Programme de demain soir\n- **`/nuit`** — Programmes nuit 00h-06h\n\n### 🎬 Filtres Spécialisés\n- **`/film`** — Films de la soirée (TNT FR)\n- **`/series`** — Séries de la soirée (TNT FR)\n- **`/sport [pays]`** — Sports du jour (FR/GB)\n- **`/live [filtre]`** — Lives en cours (canal, bein, rmc...)\n- **`/nouveautes`** — Programmes inédits\n\n### 📊 Résumés \u0026 Analyses\n- **`/resume`** — Résumé compact en ce moment\n- **`/soir5`** — Les 5 prochains soirs (vedettes)\n- **`/doublons`** — Programmes en doublon TNT (6h)\n- **`/trending`** — Titres tendance du jour\n- **`/chaine \u003cnom\u003e`** — Prochains programmes d'une chaîne\n- **`/chaines`** — Parcourir toutes les chaînes\n- **`/recherche \u003cmot\u003e`** — Recherche full-text\n\n### 🔧 Admin (réservé)\n- **`/admin`** — Panneau de contrôle\n- **`/status`** — Vue synthétique\n- **`/cache`** — État du cache EPG\n- **`/refresh [pays]`** — Forcer rechargement\n- **`/logs`** — Dernières erreurs\n- **`/stats`** — Statistiques EPG\n- Et 15+ autres commandes...\n\n---\n\n## 🏗️ Architecture Modulaire\n\n### Structures des Fichiers\n\n```\nmyepg/\n├── config.py              # Configuration (tokens, chaînes, blacklists)\n├── logger_utils.py        # Logging en mémoire\n├── utils.py               # Utilitaires (parsing, nettoyage, détection)\n├── epg_loader.py          # Chargement \u0026 cache EPG\n├── epg_query.py           # Requêtes EPG (extraction, formatage)\n├── builders.py            # Construction résultats filtrés\n├── senders.py             # Formatage \u0026 envoi messages\n├── keyboards.py           # Claviers Telegram inline\n├── decorators.py          # Décorateurs (admin_only, etc.)\n├── state.py               # État global (utilisateurs, temps démarrage)\n├── handlers_public.py     # Handlers commandes publiques\n├── handlers_admin.py      # Handlers commandes admin (à créer)\n├── callbacks.py           # Gestionnaires de callbacks (à créer)\n├── main.py                # Point d'entrée du bot (à créer)\n└── requirements.txt       # Dépendances\n```\n\n### Dépendances Entre Modules\n\n```\nconfig.py\n  ├── utils.py\n  ├── epg_loader.py\n  │   └── logger_utils.py\n  ├── keyboards.py\n  ├── builders.py\n  │   └── epg_query.py\n  ├── senders.py\n  ├── handlers_public.py\n  └── state.py\n```\n\n---\n\n## 🚀 Installation\n\n### 1. Cloner le repository\n\n```bash\ngit clone https://github.com/Deltek/MyEPG.git\ncd MyEPG\n```\n\n### 2. Créer un environnement Python\n\n```bash\npython3 -m venv venv\nsource venv/bin/activate  # Linux/Mac\n# ou\nvenv\\Scripts\\activate  # Windows\n```\n\n### 3. Installer les dépendances\n\n```bash\npip install -r requirements.txt\n```\n\n### 4. Configurer les variables d'environnement\n\n```bash\nexport BOT_TOKEN=\"votre_token_telegram\"\nexport ADMIN_USER_ID=\"votre_user_id\"\n```\n\nOu créer un fichier `.env` :\n\n```env\nBOT_TOKEN=votre_token_telegram\nADMIN_USER_ID=votre_user_id\n```\n\n### 5. Lancer le bot\n\n```bash\npython3 main.py\n```\n\n---\n\n## 📋 Configuration\n\n### Variables d'Environnement\n\n| Variable | Type | Description |\n|----------|------|-------------|\n| `BOT_TOKEN` | string | Token Telegram (obtenu via @BotFather) |\n| `ADMIN_USER_ID` | int | User ID de l'administrateur (pour `/admin` et autres commandes) |\n\n### Configuration Python (`config.py`)\n\n```python\nCACHE_TTL        = 3600  # Cache EPG expire après 1h\nPAGE_SIZE        = 20    # Résultats par page (listes chaînes)\nSEARCH_PAGE_SIZE = 5     # Résultats par page (recherche)\n```\n\n---\n\n## 🌍 Sources EPG Supportées\n\n### France 🇫🇷\n- **URL** : `https://iptv-epg.org/files/epg-fr.xml.gz`\n- **Chaînes TNT** : 27 chaînes (TF1, France 2, M6, Arte, etc.)\n- **Chaînes Sport** : 60+ chaînes (Eurosport, beIN, RMC Sport, L'Équipe, etc.)\n\n### Royaume-Uni 🇬🇧\n- **URL** : `https://iptv-epg.org/files/epg-gb.xml.gz`\n- **Chaînes FTA** : 17 chaînes (BBC, ITV, Channel 4/5, etc.)\n- **Chaînes Sport** : 15+ chaînes (Sky Sports, TNT Sports, Eurosport, etc.)\n\n---\n\n## 🧠 Logique de Détection\n\n### Films\n- Catégorie \"film\" ou durée ≥ 75 minutes\n- Exclut les séries (pas d'episode-num)\n\n### Séries\n- Catégorie \"série\", \"sitcom\", \"soap\"\n- Ou contient pattern S##E## ou \"saison #\"\n\n### Sports\n- Chaînes sport + Filtrage fillers\n- Détecte placeholders EPG\n- Exclut les annonces génériques\n\n### Inédits\n- Filtre \"new\" EPG\n- Exclut news, météo, jeux TV récurrents\n- Sport : exclut fillers sport\n\n---\n\n## 🔄 Flux de Données\n\n```\nEPG Source (gzip XML)\n        ↓\n    load_epg() [cache 1h]\n        ↓\n    ET.parse() (ElementTree)\n        ↓\n    builders.build_*() [filtrage]\n        ↓\n    senders.send_*() [formatage]\n        ↓\n    Telegram API\n        ↓\n    Utilisateur 📱\n```\n\n---\n\n## 📦 Dépendances\n\n- **`python-telegram-bot`** (≥20.0) — Bot Telegram async\n- **`requests`** — Téléchargement EPG\n- **`psutil`** (optionnel) — Monitoring mémoire\n- **`python-dotenv`** (optionnel) — Variables `.env`\n\n### Installation complète\n\n```bash\npip install python-telegram-bot\u003e=20.0 requests psutil python-dotenv\n```\n\n---\n\n## 🐛 Troubleshooting\n\n### \"BOT_TOKEN non défini\"\n```bash\nexport BOT_TOKEN=\"YOUR_TOKEN\"\necho $BOT_TOKEN  # Vérifier\n```\n\n### Cache EPG expiré\nLe bot recharge automatiquement après 1 heure. Force : `/refresh`\n\n### Performance lente\n- Vérifier mémoire : `/memoire` (admin)\n- Forcer GC : `/gc` (admin)\n\n### Chaînes manquantes\n- Vérifier EPG source : `/testepg` (admin)\n- Lister orphelines : `/chainesorphelines` (admin)\n\n---\n\n## 📊 Commandes Admin\n\n### Monitoring\n- `/status` — Vue synthétique (uptime, cache, erreurs)\n- `/ping` — Latence\n- `/memoire` — Utilisation mémoire\n- `/logs` — Dernières erreurs\n\n### EPG\n- `/cache` — État du cache\n- `/stats` — Statistiques\n- `/testepg [pays]` — Tester source EPG\n- `/refresh [pays]` — Recharger cache\n- `/diff [pays]` — Diff avec snapshot précédent\n\n### Chaînes\n- `/top [pays]` — Top 10 chaînes\n- `/cherche_id \u003cnom\u003e` — Trouver channel ID\n- `/debug \u003cid\u003e` — Programmes bruts d'une chaîne\n- `/couverture [pays]` — Couverture 24h\n- `/manquantes [pays]` — Chaînes absentes de listes\n\n### Utilitaires\n- `/blacklist` — Afficher les blacklists\n- `/gc` — Garbage collection\n- `/nbusers` — Utilisateurs distincts\n\n---\n\n## 🎨 Format Messages\n\n### Programme En Direct\n```\n🔴 ▶️ Titre du Programme 🆕\n🕐 20:00–22:30  ⏱ 2h30\n📝 Description courte...\n⏭ À 22:30 : Prochain titre\n```\n\n### Sport\n```\n🔴 20:00–22:30 ⏱ 2h30  Titre Match ⚠️\n   📝 Description courte...\n```\n\n### Résultat Recherche\n```\n📺 **Chaîne**  🕐 01/01 20:00–22:30\n▶️ Titre du Programme\n   📝 Description...\n```\n\n---\n\n## 🤝 Contribution\n\nLes contributions sont bienvenues ! Pour contribuer :\n\n1. Fork le repo\n2. Créer une branche `feature/ma-feature`\n3. Commit les changements\n4. Push et créer une Pull Request\n\n---\n\n## 📄 License\n\nMIT License — Libre d'utilisation\n\n---\n\n## 📧 Contact\n\n- **Repository** : https://github.com/Deltek/MyEPG\n- **Issues** : https://github.com/Deltek/MyEPG/issues\n\n---\n\n## 📝 Changelog\n\nVoir [CHANGELOG.md](CHANGELOG.md) pour l'historique complet des versions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeltek%2Fmyepg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeltek%2Fmyepg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeltek%2Fmyepg/lists"}