Skip to content

Update graphql query#1

Open
hernancuy wants to merge 3 commits intodrbothen:masterfrom
hernancuy:master
Open

Update graphql query#1
hernancuy wants to merge 3 commits intodrbothen:masterfrom
hernancuy:master

Conversation

@hernancuy
Copy link

@hernancuy hernancuy commented Jun 7, 2024

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

The GraphQL query were updated, related to fetchNanodegree, fetchLesson, fetchCourse, fetchUdacityUserInfo. The changes were delete fields current API do not required. Totally functional and tested at 06/06/24. Without this changes, the authentication and download course feature are not possible.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Download Nanodegree
  • Test B

Configurations

  • OS: Windows 10
  • Node version: v18.20.3
  • npm version: 10.7.0

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Vi-Ku
Copy link

Vi-Ku commented Jun 7, 2024

@drbothen HI there, i tried installing udacimak with the instruction you have given but got issues like api endpoint not available, token not able to verify. Would it be possible for you to build the docker and share it, or atleast the dockerfile, as it is having issues in building the docker also

@Vi-Ku
Copy link

Vi-Ku commented Jun 7, 2024

[10/11] RUN npm i -g udacimak:
2.309 npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
2.401 npm WARN deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
3.637 npm WARN deprecated youtube-dl@3.5.0: node-youtube-dl is deprecated. use npm.im/youtube-dl-exec instead.
10.38 npm WARN deprecated har-validator@5.1.5: this library is no longer supported
10.45 npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
15.26 npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
15.36 npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
37.15 /usr/local/nvm/versions/node/v11.1.0/bin/udacimak -> /usr/local/nvm/versions/node/v11.1.0/lib/node_modules/udacimak/lib/index.js
37.21
37.21 > youtube-dl@3.5.0 postinstall /usr/local/nvm/versions/node/v11.1.0/lib/node_modules/udacimak/node_modules/youtube-dl
37.21 > npm run check && npm run download
37.21
37.44
37.44 > youtube-dl@3.5.0 check /usr/local/nvm/versions/node/v11.1.0/lib/node_modules/udacimak/node_modules/youtube-dl
37.44 > bin-version-check python '>=2'
37.44
37.54 Error: Couldn't find the python binary. Make sure it's installed and in your $PATH.
37.54 at Process.ChildProcess._handle.onexit (internal/child_process.js:238:19)
37.54 at onErrorNT (internal/child_process.js:413:16)
37.54 at internalTickCallback (internal/process/next_tick.js:72:19)
37.54 at process._tickCallback (internal/process/next_tick.js:47:5)
37.54 at Function.Module.runMain (internal/modules/cjs/loader.js:763:11)
37.54 at startup (internal/bootstrap/node.js:308:19)
37.54 at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)
37.55 npm ERR! code ELIFECYCLE
37.55 npm ERR! errno 1
37.55 npm ERR! youtube-dl@3.5.0 check: bin-version-check python '>=2'
37.55 npm ERR! Exit status 1
37.55 npm ERR!
37.55 npm ERR! Failed at the youtube-dl@3.5.0 check script.
37.55 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
37.56
37.56 npm ERR! A complete log of this run can be found in:
37.56 npm ERR! /root/.npm/_logs/2024-06-07T17_32_06_831Z-debug.log
37.91 npm ERR! code ELIFECYCLE
37.91 npm ERR! errno 1
37.91 npm ERR! youtube-dl@3.5.0 postinstall: npm run check && npm run download
37.91 npm ERR! Exit status 1
37.91 npm ERR!
37.91 npm ERR! Failed at the youtube-dl@3.5.0 postinstall script.
37.91 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
37.95
37.95 npm ERR! A complete log of this run can be found in:
37.95 npm ERR! /root/.npm/_logs/2024-06-07T17_32_07_205Z-debug.log


Dockerfile:43

41 |
42 | # install Udacimak
43 | >>> RUN npm i -g udacimak
44 | # confirm install
45 | RUN udacimak --help

ERROR: failed to solve: process "/bin/sh -c npm i -g udacimak" did not complete successfully: exit code: 1

View build details: docker-desktop://dashboard/build/default/default/6t5hg2gso07tvvi6ghhus6lt4

@hernancuy
Copy link
Author

hernancuy commented Jun 7, 2024

I just tried with the change that I upload and its working.
just try

  1. git clone https://github.com/hernancuy/udacimak (is forked from drbother, but I update the api endpoint and it's funtional)
  2. cd udacimak
  3. npm install
  4. npm run build
  5. npm i -g .
  6. udacimak settoken YOUR_BEARER_TOKEN

Later, to confirm if can check your nanodegree enrolled

  • udacimak listnd

Finally, to download the course and render it

  1. udacimak download CODE_NANODEGREE
  2. udacimak render PATH_TO_DOWNLOADED_COURSE_JSON_DIRECTORY --targetdir OPTIONAL_TARGET_DIRECTORY

Total functional at date.

@Vi-Ku
Copy link

Vi-Ku commented Jun 7, 2024

(node:990) ExperimentalWarning: queueMicrotask() is experimental.
? Email: vvsounderya22@gmail.com
? Password: [hidden]
{ Error: getaddrinfo ENOTFOUND user-api.udacity.com user-api.udacity.com:443
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58:26)
errno: 'ENOTFOUND',
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'user-api.udacity.com',
host: 'user-api.udacity.com',
port: 443 }
root@36e672715ebb:# udacimak settoken eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjAzNjQ5NTAsImlhdCI6MTcxNzc3Mjk1MCwia2lkIjoiMTAwMCIsInVpZCI6ImIwMjhjYzAwLWZjMzUtMTFlYS05N2JlLTk3MzU1ODY3YjJhYiIsImRvbSI6IlVTIn0.K12CqakxcOFrEvZ8YHfE8uhJaMUwfsKXkV_zvHU-3fx-GWC1dEjSMpoKLvmEDkOOB2eV97scMPZHRl4qQ_yQQM16_2RmgaS9xChHe9PDzA6_u5yn3Q0YTvE_Nd93achN5szgBxjDMfT0diezNkmlgdT9tl2EMEYKWb01MqR3FvU1JTAfRw81M6-1i07WwjMphbaKj_8QSMoGR6IbpQmHxvQgvFblS8WGXN_8JyfMZXFkVJc74OnP49HI2x5xaSbX6aZiyXpfh2nUwwY1stUPVBARclSEZDQP0VGE3JuIXir0C2jIttcmAwf9JG11HXYw059y0k1Des3bwj04vBs8xg
(node:1669) ExperimentalWarning: The dns.promises API is experimental
(node:1669) ExperimentalWarning: queueMicrotask() is experimental.
✖ Validate Udacity authentication token via Udacity API
2024-06-07T17:53:48.278Z [error]: Failed to validate your Udacity token. Please try again. Here's the error message:
{}
root@36e672715ebb:
# udacimak settoken eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjAzNjQ5NTAsImlhdCI6MTcxNzc3Mjk1MCwia2lkIjoiMTAwMCIsInVpZCI6ImIwMjhjYzAwLWZjMzUtMTFlYS05N2JlLTk3MzU1ODY3YjJhYiIsImRvbSI6IlVTIn0.K12CqakxcOFrEvZ8YHfE8uhJaMUwfsKXkV_zvHU-3fx-GWC1dEjSMpoKLvmEDkOOB2eV97scMPZHRl4qQ_yQQM16_2RmgaS9xChHe9PDzA6_u5yn3Q0YTvE_Nd93achN5szgBxjDMfT0diezNkmlgdT9tl2EMEYKWb01MqR3FvU1JTAfRw81M6-1i07WwjMphbaKj_8QSMoGR6IbpQmHxvQgvFblS8WGXN_8JyfMZXFkVJc74OnP49HI2x5xaSbX6aZiyXpfh2nUwwY1stUPVBARclSEZDQP0VGE3JuIXir0C2jIttcmAwf9JG11HXYw059y0k1Des3bwj04vBs8xg
(node:1796) ExperimentalWarning: The dns.promises API is experimental
(node:1796) ExperimentalWarning: queueMicrotask() is experimental.
✖ Validate Udacity authentication token via Udacity API
2024-06-07T17:53:56.668Z [error]: Failed to validate your Udacity token. Please try again. Here's the error message:
{}
root@36e672715ebb:~# udacimak login
(node:2814) ExperimentalWarning: The dns.promises API is experimental
(node:2814) ExperimentalWarning: queueMicrotask() is experimental.
? Email: *************@gmail.com
? Password: [hidden]
{ Error: getaddrinfo ENOTFOUND user-api.udacity.com user-api.udacity.com:443
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58:26)
errno: 'ENOTFOUND',
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'user-api.udacity.com',
host: 'user-api.udacity.com',
port: 443 }

@hernancuy
Copy link
Author

Run this npm uninstall -g udacimak and execute again all of this
git clone https://github.com/hernancuy/udacimak (is forked from drbother, but I update the api endpoint and it's funtional)
cd udacimak
npm install
npm run build
npm i -g .
udacimak settoken YOUR_BEARER_TOKEN
Later, to confirm if can check your nanodegree enrolled

udacimak listnd
Finally, to download the course and render it

udacimak download CODE_NANODEGREE
udacimak render PATH_TO_DOWNLOADED_COURSE_JSON_DIRECTORY --targetdir OPTIONAL_TARGET_DIRECTORY

I test it with your token and it works

√ Validate Udacity authentication token via Udacity API
2024-06-07T18:27:44.697Z [info]: Hi sounderya. You have successfully saved authentication token locally!
PS E:\Users\Estudios\test\udacimak> udacimak listnd
(node:3112) [DEP0128] DeprecationWarning: Invalid 'main' field in 'E:\Users\Estudios\test\udacimak\node_modules\user-settings\package.json' of 'dots.js'. Please either fix that or report it to the module author
(Use node --trace-deprecation ... to show where the warning was created)
√ Fetch user information via Udacity API
2024-06-07T18:28:57.164Z [info]: Hi sounderya!
2024-06-07T18:28:57.165Z [info]:
2024-06-07T18:28:57.165Z [info]: Here's a list of your graduated Nanodegrees (list by Nanodegree key only. The API doesn't return Nanodegree name so it can't be listed here):
2024-06-07T18:28:57.165Z [info]: - nd213 version 3.4.9 (locale: en-us)
2024-06-07T18:28:57.166Z [info]: - nd209 version 4.0.9 (locale: en-us)
2024-06-07T18:28:57.166Z [info]:
2024-06-07T18:28:57.166Z [info]: Here's a list of your enrolled Nanodegrees:
2024-06-07T18:28:57.166Z [info]: - nd891 version 8.0.10 (locale: en-us): Computer Vision
2024-06-07T18:28:57.166Z [info]: - nd002-embsys version 1.0.6 (locale: en-us): Introduction to Robotics
2024-06-07T18:28:57.167Z [info]: - nd113 version 5.0.6 (locale: en-us): Introduction to Self-Driving Cars
2024-06-07T18:28:57.167Z [info]: - nd320 version 2.0.7 (locale: en-us): AI for Healthcare
2024-06-07T18:28:57.167Z [info]: - nd898 version 5.0.3 (locale: en-us): Artificial Intelligence
2024-06-07T18:28:57.167Z [info]: - nd893 version 4.0.8 (locale: en-us): Deep Reinforcement Learning
2024-06-07T18:28:57.167Z [info]: - nd101 version 14.0.25 (locale: en-us): Deep Learning
2024-06-07T18:28:57.167Z [info]: - nd229 version 8.0.0 (locale: en-us): Introduction to Machine Learning with Pytorch
2024-06-07T18:28:57.168Z [info]: - nd0013 version 4.0.8 (locale: en-us): Self Driving Car Engineer

Check it please

@Vi-Ku
Copy link

Vi-Ku commented Jun 7, 2024

thanks, it is working now.

@murk2024
Copy link

I don't know if Udacity has updated its framework. I followed your instructions to install Udacitymak, but an error occurred when I downloaded the course. Could you tell me what the problem is? I would be very grateful if you could help me solve it. The following is the error message:

[error]: Failed to download course. See error below:
[
{
"message": "Cannot query field "lesson_type" on type "Lesson".",
"status": null
}
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants