r0oth3x49 / acloud-dl

A cross-platform python based utility to download courses from acloud.guru for personal offline use.
MIT License
351 stars 142 forks source link

Unreachable files and 'NoneType' error #50

Closed vstepko closed 4 years ago

vstepko commented 4 years ago

I try to download a course "Course 'Docker for DevOps - From Development to Production", but get the error (all other courses downloads works fine):

[*] : Course 'Docker for DevOps - From Development to Production'.
Traceback (most recent call last):on .. 
  File "acloud-dl.py", line 334, in <module>
    main()
  File "acloud-dl.py", line 327, in main
    acloud.course_download(path=options.output, quality=options.quality, download_all=options.download_all)
  File "acloud-dl.py", line 209, in course_download
    course = course.get_course(keep_alive=download_all)
  File "/home/pride/acloud-dl-master/acloud/_shared.py", line 88, in get_course
    self._process_course(keep_alive=keep_alive)
  File "/home/pride/acloud-dl-master/acloud/_internal.py", line 69, in _process_course
    self._course = InternCloudGuruCourse(self._info, self._session, keep_alive)
  File "/home/pride/acloud-dl-master/acloud/_internal.py", line 79, in __init__
    super(InternCloudGuruCourse, self).__init__()
  File "/home/pride/acloud-dl-master/acloud/_shared.py", line 109, in __init__
    self._fetch_course()
  File "/home/pride/acloud-dl-master/acloud/_internal.py", line 85, in _fetch_course
    self._info              =       self._real_extract(course_id=course_id)        
  File "/home/pride/acloud-dl-master/acloud/_extract.py", line 486, in _real_extract
    'lectures' : self._extract_lectures(lectures)
  File "/home/pride/acloud-dl-master/acloud/_extract.py", line 381, in _extract_lectures
    sub_id = self._extract_sub_id(videoposter)
  File "/home/pride/acloud-dl-master/acloud/_extract.py", line 358, in _extract_sub_id
    videoposter = videoposter.rsplit("/", 1)[-1]
AttributeError: 'NoneType' object has no attribute 'rsplit'

The same situation with the course "Introduction to Ansible".

For the course "AZ-103 Microsoft Azure Administrator 2020" most files are unreachable. But some of them I can download.

Course 'AZ-103 Microsoft Azure Administrator 2020'.
[*] : Downloaded course information .. (done)
[+] : Chapter(s) (24).
[*] : Lecture(s) (100).

[*] : Downloading chapter : (1 of 24)
[+] : Chapter (01 Course Introduction and Resources)
[*] : Found (2) lectures ...

[*] : Lecture(s) : (1 of 2)
[*] : Downloading (001 Welcome)
[*] : Lecture : '001 Welcome' (download skipped).
[-] : URLError : either your internet connection is not working or server aborted the request

[*] : Lecture(s) : (2 of 2)
[*] : Downloading (002 Azure High Level Overview)
[*] : Lecture : '002 Azure High Level Overview' (download skipped).
[-] : URLError : either your internet connection is not working or server aborted the request

[*] : Downloading chapter : (2 of 24)
[+] : Chapter (02 Manage Azure Subscriptions)
[*] : Found (6) lectures ...

[*] : Lecture(s) : (1 of 6)
[*] : Downloading (001 Intro to Accounts and Subscriptions)
[*] : Lecture : '001 Intro to Accounts and Subscriptions' (download skipped).
[-] : URLError : either your internet connection is not working or server aborted the request

[*] : Lecture(s) : (2 of 6)
[*] : Downloading (002 Accessing Azure)
[*] : 30.11MB/30.11MB 100.00% |##############################| 5.74MB/s 
[+] : Downloaded  (002 Accessing Azure)

The same situation with courses "Google Kubernetes Engine (GKE)_ Beginner to Pro" but on that course all files are unreachable.

vstepko commented 4 years ago

Also, error when downloading AWS CodeDeploy:

[*] : Course 'AWS CodeDeploy'.
Traceback (most recent call last):on .. 
  File "acloud-dl.py", line 334, in <module>
    main()
  File "acloud-dl.py", line 327, in main
    acloud.course_download(path=options.output, quality=options.quality, download_all=options.download_all)
  File "acloud-dl.py", line 209, in course_download
    course = course.get_course(keep_alive=download_all)
  File "/home/pride/acloud-dl-master/acloud/_shared.py", line 88, in get_course
    self._process_course(keep_alive=keep_alive)
  File "/home/pride/acloud-dl-master/acloud/_internal.py", line 69, in _process_course
    self._course = InternCloudGuruCourse(self._info, self._session, keep_alive)
  File "/home/pride/acloud-dl-master/acloud/_internal.py", line 79, in __init__
    super(InternCloudGuruCourse, self).__init__()
  File "/home/pride/acloud-dl-master/acloud/_shared.py", line 109, in __init__
    self._fetch_course()
  File "/home/pride/acloud-dl-master/acloud/_internal.py", line 85, in _fetch_course
    self._info              =       self._real_extract(course_id=course_id)        
  File "/home/pride/acloud-dl-master/acloud/_extract.py", line 486, in _real_extract
    'lectures' : self._extract_lectures(lectures)
  File "/home/pride/acloud-dl-master/acloud/_extract.py", line 405, in _extract_lectures
    sources = self._extract_sources(sources)
  File "/home/pride/acloud-dl-master/acloud/_extract.py", line 246, in _extract_sources
    'height' : height,
UnboundLocalError: local variable 'height' referenced before assignment
r0oth3x49 commented 4 years ago

@vstepko i might need an account to reproduce and fix. if you are okay with sharing you can email it to my personal email nasir251292@gmail.com.

mavericksrini commented 4 years ago

I also have some problem while downloading the following course AWS Certified Solutions Architect Associate SAA-CO2

[] : Lecture(s) : (14 of 27) [] : Downloading (014 Sharing S3 Buckets Across Accounts - Lab SAA-C02) [*] : Lecture : '014 Sharing S3 Buckets Across Accounts - Lab SAA-C02' (download skipped). [-] : URLError : either your internet connection is not working or server aborted the request

[] : Lecture(s) : (15 of 27) [] : Downloading (015 Cross-Region Replication - Lab) [*] : Lecture : '015 Cross-Region Replication - Lab' (download skipped). [-] : URLError : either your internet connection is not working or server aborted the request

[] : Downloading asset(s) [] : Downloading (015 DOCS AWS S3 Replication Configuration.html) [*] : 55.17KB/55.17KB 100.00% |##############################| 1021.59kB/s a 00:00s [+] : Downloaded (015 DOCS AWS S3 Replication Configuration.html)

[] : Lecture(s) : (16 of 27) [] : Downloading (016 S3 Transfer Acceleration) [*] : 55.60MB/55.60MB 100.00% |##############################| 4.65MB/s ta 00:00ss [+] : Downloaded (016 S3 Transfer Acceleration)

[] : Downloading asset(s) [] : Downloading (016 S3 Transfer Acceleration Link.html) [*] : 22.28KB/22.28KB 100.00% |##############################| 10.88MB/s ta 00:00s [+] : Downloaded (016 S3 Transfer Acceleration Link.html)

[] : Lecture(s) : (17 of 27) [] : Downloading (017 AWS DataSync SAA-C02) [*] : 18.42MB/18.42MB 100.00% |##############################| 3.42MB/s ta 00:00ss [+] : Downloaded (017 AWS DataSync SAA-C02)

[] : Lecture(s) : (18 of 27) [] : Downloading (018 CloudFront) [*] : Lecture : '018 CloudFront' (download skipped). [-] : URLError : either your internet connection is not working or server aborted the request

[] : Lecture(s) : (19 of 27) [] : Downloading (019 Create a CloudFront Distribution - Lab) [*] : Lecture : '019 Create a CloudFront Distribution - Lab' (download skipped). [-] : URLError : either your internet connection is not working or server aborted the request

mavericksrini commented 4 years ago
          __                __          ____

__/ /_ ____/ / __/ / / / `/ _/ / \/ / / / // / / / // / // / // / // / // /____/ // / / _,_/_//___/\,/_,_/ \,//

                             Version : 0.1
                             Author  : Nasir Khan (r0ot h3x49)
                             Github  : https://github.com/r0oth3x49

[*] : Downloading accessible courses information .. (done) [1] : AWS Certified Cloud Practitioner 2020 [2] : AWS Certified DevOps Engineer - Professional 2020 [3] : AWS Certified Solutions Architect Associate SAA-CO2 [4] : AWS ECS - Scaling Docker [5] : Introduction to AWS [6] : S3 Masterclass [7] : Serverless for Beginners [8] : Mastering the AWS Well-Architected Framework [9] : Coding for Cloud 101 [10] : Docker Fundamentals [11] : LPI DevOps Tools Engineer Certification [12] : Introduction to Ansible [13] : Kubernetes Deep Dive [14] : Kubernetes Fundamentals [?] : select course number or range (1/14/range):

And when Downloading Introduction to Ansible it throws the following error

Traceback (most recent call last):on .. File "acloud-dl.py", line 334, in main() File "acloud-dl.py", line 327, in main acloud.course_download(path=options.output, quality=options.quality, download_all=options.download_all) File "acloud-dl.py", line 209, in course_download course = course.get_course(keep_alive=download_all) File "C:\Users\@@@@\Downloads\acloud-dl-master\acloud_shared.py", line 88, in get_course self._process_course(keep_alive=keep_alive) File "C:\Users\@@@@\Downloads\acloud-dl-master\acloud_internal.py", line 69, in _process_course self._course = InternCloudGuruCourse(self._info, self._session, keep_alive) File "C:\Users\@@@@\Downloads\acloud-dl-master\acloud_internal.py", line 79, in init super(InternCloudGuruCourse, self).init() File "C:\Users\@@@@\Downloads\acloud-dl-master\acloud_shared.py", line 109, in init self._fetch_course() File "C:\Users\@@@@\Downloads\acloud-dl-master\acloud_internal.py", line 85, in _fetch_course self._info = self._real_extract(course_id=course_id) File "C:\Users\@@@@\Downloads\acloud-dl-master\acloud_extract.py", line 486, in _real_extract 'lectures' : self._extract_lectures(lectures) File "C:\Users\@@@@\Downloads\acloud-dl-master\acloud_extract.py", line 405, in _extract_lectures sources = self._extract_sources(sources) File "C:\Users\@@@@\Downloads\acloud-dl-master\acloud_extract.py", line 246, in _extract_sources 'height' : height, UnboundLocalError: local variable 'height' referenced before assignment

TheDreamSaver commented 4 years ago

[] : Course 'AWS Certified Developer - Associate 2020'. [] : Downloaded course information .. (done) [+] : Chapter(s) (13). [*] : Lecture(s) (123).

[] : Downloading chapter : (1 of 13) [+] : Chapter (01 Introduction) [] : Found (3) lectures ...

[] : Lecture(s) : (1 of 3) [] : Downloading (001 Introduction) Traceback (most recent call last): File "acloud-dl.py", line 334, in main() File "acloud-dl.py", line 327, in main acloud.course_download(path=options.output, quality=options.quality, download_all=options.download_all) File "acloud-dl.py", line 243, in course_download self.download_lectures_only(lecture_best=lecture_best, lecture_title=lecture_title, inner_index=lecture_index, lectures_count=lectures_count, lecture_assets=lecture_assets, lecture_subs=lecture_subs, filepath=filepath) File "acloud-dl.py", line 174, in download_lectures_only self.download_lectures(lecture_best=lecture_best, lecture_title=lecture_title, inner_index=inner_index, lectures_count=lectures_count, filepath=filepath) File "acloud-dl.py", line 159, in download_lectures retval = lecture_best.download(filepath=filepath, quiet=True, callback=self.show_progress) File "/mnt/d/acloud-dl-master/acloud/_shared.py", line 380, in download req = compat_request(self.url, headers={'User-Agent' : HEADERS.get('User-Agent')}) File "/usr/lib/python2.7/urllib2.py", line 229, in init self.__original = unwrap(url) File "/usr/lib/python2.7/urllib.py", line 1073, in unwrap url = url.strip() AttributeError: 'dict' object has no attribute 'strip'

sakkumits commented 4 years ago

I also have same issue. Getting this error for few videos inside a course or sometime for all videos inside a course.