python
  • google-drive-sdk
  • 2012-09-10 5 views 2 likes 
    2

    Google 드라이브 python 클라이언트를 사용하여 mimeType 오디오/mpeg 또는 audio/flac 또는 audio/ogg가있는 모든 파일 유형을 선택하려고합니다. 단일 쿼리에서 어떻게이 작업을 수행 할 수 있습니까? 나는 시도했다 :Google 드라이브 API 개체의 OR 필터

    files = drive.files().list().setQ("mimeType='audio/mpeg OR mimeType='audio/flac'").execute() 
    

    그러나이 요청이 올바른 결과를 산출하는 데 실패했습니다.

    mimeType='audio/mpeg' OR mimeType='audio/flac' 
            ^
    

    하지만 여전히 Google 드라이브 API는 or 연산자를 지원하지 않습니다, 그래서 당신은 순서대로 원하는 얻을 두 개의 쿼리를 수행해야한다 : 당신은 당신의 쿼리와 쿼리에서 하나의 작은 따옴표를 잃었다

    답변

    2

    이 잘못되었습니다 검색 결과 :

    mpegs = drive.files().list().setQ("mimeType='audio/mpeg'").execute() 
    flacs = drive.files().list().setQ("mimeType='audio/flac'").execute() 
    
    관련 문제