At my python application I want to get the sum of segment_upload_list but only for objects that are stored locally, so basically every entry starting with "/tmp/VODProcessing/". This is how my full list might look like:
[['/tmp/VODProcessing/output/1 Se Pone Mas/master.m3u8', "Music/D'can/Se Pone Mas/1 Se Pone Mas/master.m3u8"], ['/tmp/VODProcessing/output/1 Se Pone Mas/a-flac/f-0007.m4s', "Music/D'can/Se Pone Mas/1 Se Pone Mas/a-flac/f-0007.m4s"], ['/tmp/VODProcessing/output/1 Se Pone Mas/a-flac/f-0022.m4s', "Music/D'can/Se Pone Mas/1 Se Pone Mas/a-flac/f-0022.m4s"], ['/tmp/VODProcessing/output/1 Se Pone Mas/a-flac/f-0030.m4s', "Music/D'can/Se Pone Mas/1 Se Pone Mas/a-flac/f-0030.m4s"], ['/tmp/VODProcessing/output/1 Se Pone Mas/a-flac/f-0001.m4s', "Music/D'can/Se Pone Mas/1 Se Pone Mas/a-flac/f-0001.m4s"]]
I wanted to get the sum like this:
totalsize = sum([os.stat(f).st_size for f in segment_upload_list[0]])
but [0]
does not really make much sense here. How can I sum all local paths here?
Thanks in advance