ReneR97 / domestika-downloader

Download full domestika courses
https://www.buymeacoffee.com/ReneR97
49 stars 14 forks source link

Plus subcription courses download #3

Closed raftutak closed 1 year ago

raftutak commented 1 year ago

Thanks for sharing it! Is there a way to download courses that are not actually added to my library (not bought for cash or credits) but I can access them with my Domestika Plus subscription? It looks like there is no videos array available in the data object (retrieved with getInitialProps) for such courses even though I can watch them online.

Error

/Users/xxx/Repositories/domestika-downloader/index.js:136
        for (let i = 0; i < data.videos.length; i++) {
                                        ^
TypeError: Cannot read properties of undefined (reading 'length')
    at getInitialProps (/Users/xxx/Repositories/domestika-downloader/index.js:136:41)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async scrapeSite (/Users/xxx/Repositories/domestika-downloader/index.js:56:25)

Data object

{
  user: {
    settings: { audioLanguage: 'es', subtitleLanguage: 'en', isEmpty: false }
  },
  course: {
    id: 3043,
    cover: 'https://cdn.domestika.org/c_fill,dpr_auto,f_auto,pg_1,t_base_params/v1652427744/course-covers/000/003/043/3043-original.jpg?1652427744',
    totalNumUnits: 4,
    totalNumLessons: 15
  },
  video: {
    id: 54601,
    cover: 'https://i.vimeocdn.com/video/1431079023-c47906653e8c57038a3792f8da1a1567c5eb2a4c9730f1925d50527990858106-d_1280x720',
    duration: 145,
    playbackURL: 'https://lambda-videos.domestika.org/master.m3u8?fallback_url=https%253A%252F%252Fwww.domestika.org%252Fapi%252Fv2%252Fvideo_item_m3u8%252F54601.m3u8&provider_playlist_url=https%253A%252F%252Fplayer.vimeo.com%252Fexternal%252F695778529.m3u8%253Fs%253D19a5a25cac043182642929093c47d6facc98ff49%2526oauth2_token_id%xxx&static_playlist_url=https%253A%252F%252Fcdn-videos.domestika.org%252Fvideos%252F000%252F054%252F601%252Fa09c543c608c1eee725d2f6fd99d1f51%252Fmaster.m3u8%253F1676406911',
    isTrailer: true,
    allowPlay: true,
    thumbnailsURL: 'https://cdn-videos.domestika.org/videos/000/054/601/a09c543c608c1eee725d2f6fd99d1f51/thumbnails/thumbnails.vtt?1676406912'
  }
}
ReneR97 commented 1 year ago

Hello, just tried it and it worked fine for me. This is the course you where trying to download right? https://www.domestika.org/en/courses/3043-colorful-retail-space-design/

Maybe try setting everything again Setting the cookies again and make sure the URL is right (https://www.domestika.org/en/courses/3043-colorful-retail-space-design/course)