mirror of
https://github.com/fastogt/fastocloud_admin.git
synced 2025-03-09 23:38:52 +00:00
1.5.0 Release
This commit is contained in:
commit
4ac16f3288
127 changed files with 16598 additions and 0 deletions
27
scripts/parse_streams_collection.py
Executable file
27
scripts/parse_streams_collection.py
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
from mongoengine import connect
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
||||
|
||||
PROJECT_NAME = 'parse_streams_collection'
|
||||
|
||||
from app.common.stream.entry import IStream
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(prog=PROJECT_NAME, usage='%(prog)s [options]')
|
||||
parser.add_argument('--mongo_uri', help='MongoDB credentials', default='mongodb://localhost:27017/iptv')
|
||||
|
||||
argv = parser.parse_args()
|
||||
|
||||
mongo = connect(host=argv.mongo_uri)
|
||||
if mongo:
|
||||
streams = IStream.objects()
|
||||
f = open("out.m3u", "w")
|
||||
f.write('#EXTM3U\n')
|
||||
idx = 0
|
||||
for stream in streams:
|
||||
f.write(stream.generate_input_playlist(False))
|
||||
f.close()
|
||||
Loading…
Add table
Add a link
Reference in a new issue