Hola ante todo gracias por la ayuda
Soy nueva en python y estoy dando mis primeros pasos. Resulta que tengo un archivo de miles de filas. El contenido de los stringstring
que contiene cada fila puede ser de dos clases (os dejo la captura de ambos tipo de string)(os dejo la captura de ambos tipo de string) y viene determinado por un label llamado "mime" el cual puede ser video o audio.
Mi problema consiste en que no se como extraer el valor de las variablesvariables "lmt", "mime", "itag", "dur" prsentes en cada linea y al final alamcenarlosalmacenarlos en uun archivo .csv.csv
.
He probado dividiendo y creando un nuevo archivo y usando vectores. Pero no llego a una solución (me siento un pelin frustrada)(me siento un tanto frustrada).
-------String1----------------------------------------------------------------------------------------------------String1:
Line 219 (6420),Dh," ""url"": ""https://r3---sn-gxqpgpn-h5ql.googlevideo.com/videoplayback?ipbits=0&requiressl=yes&gir=yes&pcm2cms=yes&ip=150.214.57.8&fvip=5&c=WEB&id=o-AKPE5P1-L_x8zzDRYj5aoX3bYJ1W02pyCMpEI4-dsRC-&gcr=es&mm=31%2C29&mn=sn-gxqpgpn-h5ql%2Csn-h5q7dnlk&signature=201841BEA18EE01EE5C51CEE1487A4CAC75DED51.0B35DB9CB1ADB52AFFF24A3250F9B1C5708068ED&keepalive=yes&sparams=clen%2Cdur%2Cei%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Crequiressl%2Csource%2Cexpire&mt=1541693372&mv=m&initcwndbps=642500&ms=au%2Crdu&itag=251&mime=audio%2Fwebm&pl=16&expire=1541715093&clen=1853458&ei=NWDkW6LwLJic1waombfoBQ&key=yt6&source=youtube&dur=117.241&txp=5511222&lmt=1538050727946448&alr=yes&cpn=mH58o0Uz_dI7ZuKp&cver=2.20181106&range=309760-378453&rn=27&rbuf=5457"","
Line 219 (6420),Dh," ""url"": ""https://r3---sn-gxqpgpn-h5ql.googlevideo.com/videoplayback?ipbits=0&requiressl=yes&gir=yes&pcm2cms=yes&ip=150.214.57.8&fvip=5&c=WEB&id=o-AKPE5P1-L_x8zzDRYj5aoX3bYJ1W02pyCMpEI4-dsRC-&gcr=es&mm=31%2C29&mn=sn-gxqpgpn-h5ql%2Csn-h5q7dnlk&signature=201841BEA18EE01EE5C51CEE1487A4CAC75DED51.0B35DB9CB1ADB52AFFF24A3250F9B1C5708068ED&keepalive=yes&sparams=clen%2Cdur%2Cei%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Crequiressl%2Csource%2Cexpire&mt=1541693372&mv=m&initcwndbps=642500&ms=au%2Crdu&itag=251&mime=audio%2Fwebm&pl=16&expire=1541715093&clen=1853458&ei=NWDkW6LwLJic1waombfoBQ&key=yt6&source=youtube&dur=117.241&txp=5511222&lmt=1538050727946448&alr=yes&cpn=mH58o0Uz_dI7ZuKp&cver=2.20181106&range=309760-378453&rn=27&rbuf=5457"","
-------String2--------------------------------------------------------------String2:
Line 479 (106021),Dh," ""url"": ""https://r3---sn-gxqpgpn-h5ql.googlevideo.com/videoplayback?ipbits=0&requiressl=yes&gir=yes&pcm2cms=yes&ip=150.214.57.8&fvip=5&xtags=vproj%3Dmesh&c=WEB&id=o-AKPE5P1-L_x8zzDRYj5aoX3bYJ1W02pyCMpEI4-dsRC-&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C264%2C266%2C271%2C278%2C298%2C299%2C302%2C303%2C304%2C305%2C308%2C313%2C315&mm=31%2C29&mn=sn-gxqpgpn-h5ql%2Csn-h5q7dnlk&signature=369A4451CD5098765653E430D3FBFF20D4F8EF36.349B11C21BE7DEDFA4CA70F8365808EB9153FE4C&keepalive=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Crequiressl%2Csource%2Cxtags%2Cexpire&mt=1541693372&mv=m&initcwndbps=642500&ms=au%2Crdu&itag=315&mime=video%2Fwebm&pl=16&gcr=es&expire=1541715093&clen=347859091&ei=NWDkW6LwLJic1waombfoBQ&key=yt6&source=youtube&dur=117.183&lmt=1492587801555590&alr=yes&cpn=mH58o0Uz_dI7ZuKp&cver=2.20181106&range=32056563-38295938&rn=28&rbuf=5553"","
Line 479 (106021),Dh," ""url"": ""https://r3---sn-gxqpgpn-h5ql.googlevideo.com/videoplayback?ipbits=0&requiressl=yes&gir=yes&pcm2cms=yes&ip=150.214.57.8&fvip=5&xtags=vproj%3Dmesh&c=WEB&id=o-AKPE5P1-L_x8zzDRYj5aoX3bYJ1W02pyCMpEI4-dsRC-&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C264%2C266%2C271%2C278%2C298%2C299%2C302%2C303%2C304%2C305%2C308%2C313%2C315&mm=31%2C29&mn=sn-gxqpgpn-h5ql%2Csn-h5q7dnlk&signature=369A4451CD5098765653E430D3FBFF20D4F8EF36.349B11C21BE7DEDFA4CA70F8365808EB9153FE4C&keepalive=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Crequiressl%2Csource%2Cxtags%2Cexpire&mt=1541693372&mv=m&initcwndbps=642500&ms=au%2Crdu&itag=315&mime=video%2Fwebm&pl=16&gcr=es&expire=1541715093&clen=347859091&ei=NWDkW6LwLJic1waombfoBQ&key=yt6&source=youtube&dur=117.183&lmt=1492587801555590&alr=yes&cpn=mH58o0Uz_dI7ZuKp&cver=2.20181106&range=32056563-38295938&rn=28&rbuf=5553"","
AgradeceriaAgradecería mucho cualquier ayuda. Al final lo que quiero es un archivo que contenga los siguientes datos de salida:
Archivo .csv de salida: