I have a string '[123456] Filename123' and I want to get only the numbers inside [].
Input: [123456] Filename123
, Output: ['123456']
, I want 123456
My code:
from plexapi.server import PlexServer
import re
authType = 1
def getNumbers(str):
str = re.findall(r'[0-9].....', str)
return str
if authType == 1:
baseurl = 'http://localhost:32400'
token = 'token'
plex = PlexServer(baseurl, token)
pics = plex.library.section('Pictures')
print(pics.search())
for name in pics.search():
print(name.title)
print(getNumbers(name.title))