Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import shutil
- import re
- import os
- """
- filelist = 'chunklist.m3u8'
- link = 'http://82.80.192.30/walla_vod/_definst_/mp4:media/015/032/1503200-40.mp4/'
- with open('%s' % filelist, 'r') as playlist:
- ts_filenames = [line.rstrip() for line in playlist
- if line.rstrip().endswith('.ts')]
- count = 0
- fo = open("filelist.txt", "wb")
- for ts_file in ts_filenames:
- count = count + 1
- fo.write(link + ts_file)
- fo.write("\n")
- fo.close()
- print 'Total files : %d' %count
- if not os.path.exists('temp'):
- os.makedirs('temp')
- """
- """
- filelist = 'chunklist.m3u8'
- with open('%s' % filelist, 'r') as playlist:
- ts_filenames = [line.rstrip() for line in playlist
- if line.rstrip().endswith('.ts')]
- newname = 'newfile.ts'
- with open(newname, 'wb') as merged:
- for ts_file in ts_filenames:
- with open("temp/%s" %(ts_file), 'rb') as mergefile:
- shutil.copyfileobj(mergefile, merged)
- print "Done"
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement